On Sat, Oct 04, 2014 at 12:55:13AM +0200, René Scharfe wrote:

> >-void foreach_alt_odb(alt_odb_fn fn, void *cb)
> >+int foreach_alt_odb(alt_odb_fn fn, void *cb)
> >  {
> >     struct alternate_object_database *ent;
> >+    int r = 0;
> >
> >     prepare_alt_odb();
> >-    for (ent = alt_odb_list; ent; ent = ent->next)
> >-            if (fn(ent, cb))
> >-                    return;
> >+    for (ent = alt_odb_list; ent; ent = ent->next) {
> >+            int r = fn(ent, cb);
> >+            if (r)
> >+                    break;
> >+    }
> >+    return r;
> 
> This will always return zero.  You probably shadowed r unintentionally
> inside the loop, right?

Eek, yes. Thanks for catching. I'll fix it in the re-roll.

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to