Re: [PATCH 4/7] grep: re-order rev-parsing loop

2017-02-14 Thread Brandon Williams
On 02/14, Jeff King wrote: > - /* Is it a rev? */ > - if (!get_sha1_with_context(arg, 0, sha1, )) { > - struct object *object = parse_object_or_die(sha1, arg); > - if (!seen_dashdash) > -

[PATCH 4/7] grep: re-order rev-parsing loop

2017-02-13 Thread Jeff King
We loop over the arguments, but every branch of the loop hits either a "continue" or a "break". Surely we can make this simpler. The final conditional is: if (arg is a rev) { ... handle rev ... continue; } break; We can rewrite this as: if (arg is not a rev)