Skip to content

Commit

Permalink
query_refspecs(): move some constants out of the loop
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Michael Haggerty authored and Junio C Hamano committed Oct 30, 2013
1 parent 0838bf4 commit 049bff8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions remote.c
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,8 @@ static int query_refspecs(struct refspec *refs, int ref_count, struct refspec *q
{
int i;
int find_src = !query->src;
const char *needle = find_src ? query->dst : query->src;
char **result = find_src ? &query->src : &query->dst;

if (find_src && !query->dst)
return error("query_refspecs: need either src or dst");
Expand All @@ -833,8 +835,6 @@ static int query_refspecs(struct refspec *refs, int ref_count, struct refspec *q
struct refspec *refspec = &refs[i];
const char *key = find_src ? refspec->dst : refspec->src;
const char *value = find_src ? refspec->src : refspec->dst;
const char *needle = find_src ? query->dst : query->src;
char **result = find_src ? &query->src : &query->dst;

if (!refspec->dst)
continue;
Expand Down

0 comments on commit 049bff8

Please sign in to comment.