diff options
| author | Jeff King <peff@peff.net> | 2017-07-07 05:07:58 -0400 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2017-07-09 10:00:48 -0700 |
| commit | 7c2f08aa7a26e68475abe5c9fd7250aacbb6b7b2 (patch) | |
| tree | 069ca7fdfb4b871f1c2603db44f9407332cfadab /gitweb/gitweb.perl | |
| parent | log: do not free parents when walking reflog (diff) | |
| download | git-7c2f08aa7a26e68475abe5c9fd7250aacbb6b7b2.tar.gz git-7c2f08aa7a26e68475abe5c9fd7250aacbb6b7b2.zip | |
get_revision_1(): replace do-while with an early return
The get_revision_1() function tries to avoid entering its
main loop at all when there are no commits to look at. But
it's perfectly safe to call pop_commit() on an empty list
(in which case it will return NULL). Switching to an early
return from the loop lets us skip repeating the loop
condition before we enter the do-while. That will get more
important when we start pulling reflog-walk commits from a
source besides the revs->commits queue, as that condition
will get much more complicated.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'gitweb/gitweb.perl')
0 files changed, 0 insertions, 0 deletions
