diff options
author | Justus Winter <justus@g10code.com> | 2017-02-28 16:19:18 +0100 |
---|---|---|
committer | Justus Winter <justus@g10code.com> | 2017-02-28 16:19:18 +0100 |
commit | e4583ae14e52482ab390c102d071755f91ab211d (patch) | |
tree | 30f28c89237eee0e13ea8425fd696613b9f68259 /tests | |
parent | gpgscm: Fix calculating the line number. (diff) | |
download | gnupg2-e4583ae14e52482ab390c102d071755f91ab211d.tar.xz gnupg2-e4583ae14e52482ab390c102d071755f91ab211d.zip |
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 <justus@g10code.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/gpgscm/scheme.c | 3 |
1 files changed, 3 insertions, 0 deletions
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); } |