From e4583ae14e52482ab390c102d071755f91ab211d Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Tue, 28 Feb 2017 16:19:18 +0100 Subject: gpgscm: Improve parsing. * tests/gpgscm/scheme.c (port_increment_current_line): Avoid creating the same integer if the delta is zero. This happens a lot during parsing, and puts pressure on the memory allocator. Signed-off-by: Justus Winter --- tests/gpgscm/scheme.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests/gpgscm/scheme.c') diff --git a/tests/gpgscm/scheme.c b/tests/gpgscm/scheme.c index 0453754a6..b2ff72145 100644 --- a/tests/gpgscm/scheme.c +++ b/tests/gpgscm/scheme.c @@ -1735,6 +1735,9 @@ port_clear_location (scheme *sc, port *p) static void port_increment_current_line (scheme *sc, port *p, long delta) { + if (delta == 0) + return; + p->curr_line = mk_integer(sc, ivalue_unchecked(p->curr_line) + delta); } -- cgit v1.2.3