From 994bb6e9ef5ae7fac447c17e4bc01f49853d4679 Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Fri, 20 Feb 2009 23:39:29 +0100 Subject: [PATCH] Use temporary variable in refs loop in main_draw --- tig.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tig.c b/tig.c index 81a97b6..9349f69 100644 --- a/tig.c +++ b/tig.c @@ -6022,23 +6022,24 @@ main_draw(struct view *view, struct line *line, unsigned int lineno) size_t i = 0; do { + struct ref *ref = commit->refs[i]; enum line_type type; - if (commit->refs[i]->head) + if (ref->head) type = LINE_MAIN_HEAD; - else if (commit->refs[i]->ltag) + else if (ref->ltag) type = LINE_MAIN_LOCAL_TAG; - else if (commit->refs[i]->tag) + else if (ref->tag) type = LINE_MAIN_TAG; - else if (commit->refs[i]->tracked) + else if (ref->tracked) type = LINE_MAIN_TRACKED; - else if (commit->refs[i]->remote) + else if (ref->remote) type = LINE_MAIN_REMOTE; else type = LINE_MAIN_REF; if (draw_text(view, type, "[", TRUE) || - draw_text(view, type, commit->refs[i]->name, TRUE) || + draw_text(view, type, ref->name, TRUE) || draw_text(view, type, "]", TRUE)) return TRUE; -- 2.32.0.93.g670b81a890