From: Jonas Fonseca Date: Wed, 28 Jan 2009 18:28:03 +0000 (+0100) Subject: Remove preallocation of view lines in help_open X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=7e82d90ea94f5ab62679ae54fdd783ce65e82bd1;p=tig.git Remove preallocation of view lines in help_open --- diff --git a/tig.c b/tig.c index 095e9c6..32f5c7c 100644 --- a/tig.c +++ b/tig.c @@ -3609,22 +3609,11 @@ static struct view_ops diff_ops = { static bool help_open(struct view *view) { - int lines = ARRAY_SIZE(req_info) + 2; int i; if (view->lines > 0) return TRUE; - for (i = 0; i < ARRAY_SIZE(req_info); i++) - if (!req_info[i].request) - lines++; - - lines += run_requests + 1; - - view->line = calloc(lines, sizeof(*view->line)); - if (!view->line) - return FALSE; - add_line_text(view, "Quick reference for tig keybindings:", LINE_DEFAULT); for (i = 0; i < ARRAY_SIZE(req_info); i++) {