[Pkg-gnupg-commit] [gnupg2] 149/166: gpgscm: Improve parsing.
Daniel Kahn Gillmor
dkg at fifthhorseman.net
Thu Mar 16 22:33:15 UTC 2017
This is an automated email from the git hooks/post-receive script.
dkg pushed a commit to branch experimental
in repository gnupg2.
commit e4583ae14e52482ab390c102d071755f91ab211d
Author: Justus Winter <justus at g10code.com>
Date: Tue Feb 28 16:19:18 2017 +0100
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 at g10code.com>
---
tests/gpgscm/scheme.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tests/gpgscm/scheme.c b/tests/gpgscm/scheme.c
index 0453754..b2ff721 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);
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git
More information about the Pkg-gnupg-commit
mailing list