From 7e82d90ea94f5ab62679ae54fdd783ce65e82bd1 Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Wed, 28 Jan 2009 19:28:03 +0100 Subject: [PATCH] Remove preallocation of view lines in help_open --- tig.c | 11 ----------- 1 file changed, 11 deletions(-) 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++) { -- 2.30.2