Re: [WIP/PATCH v5 02/10] for-each-ref: clean up code

2015-06-08 Thread Matthieu Moy
Karthik Nayak karthik@gmail.com writes:

 In 'grab_single_ref()' remove the extra count variable 'cnt' and
 use the variable 'grab_cnt' of structure 'grab_ref_cbdata' directly
 instead.

 Change comment in 'struct ref_sort' to reflect changes in code.

I don't see how the comment change is related to the code change:

  struct ref_sort {
   struct ref_sort *next;
 - int atom; /* index into used_atom array */
 + int atom; /* index into 'struct atom_value *' array */
   unsigned reverse : 1;
  };
  
 @@ -881,7 +881,6 @@ static int grab_single_ref(const char *refname, const 
 unsigned char *sha1, int f
  {
   struct grab_ref_cbdata *cb = cb_data;
   struct refinfo *ref;
 - int cnt;
  
   if (flag  REF_BAD_NAME) {
 warning(ignoring ref with broken name %s, refname);
 @@ -898,10 +897,8 @@ static int grab_single_ref(const char *refname, const 
 unsigned char *sha1, int f
*/
   ref = new_refinfo(refname, sha1, flag);
  
 - cnt = cb-grab_cnt;
 - REALLOC_ARRAY(cb-grab_array, cnt + 1);
 - cb-grab_array[cnt++] = ref;
 - cb-grab_cnt = cnt;
 + REALLOC_ARRAY(cb-grab_array, cb-grab_cnt + 1);
 + cb-grab_array[cb-grab_cnt++] = ref;
   return 0;
  }

Did you squash the comment change into the wrong commit?

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [WIP/PATCH v5 02/10] for-each-ref: clean up code

2015-06-08 Thread Matthieu Moy
Karthik Nayak karthik@gmail.com writes:

 I put these two together as they are trivial changes.
 Either I could reword the commit message or split the commit.

I'd split the commit. Actually, even though it's only a small comment
change, it's not so trivial in the sense that one needs a good
understanding of the code to check the correctness of your patch.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html