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>
This commit is contained in:
Justus Winter 2017-02-28 16:19:18 +01:00
parent 058c97f9fc
commit e4583ae14e
No known key found for this signature in database
GPG Key ID: DD1A52F9DA8C9020
1 changed files with 3 additions and 0 deletions

View File

@ -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);
}