summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2014-06-04 17:42:46 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2014-06-04 17:42:50 +0200
commit10b9817e978c37a8193dea17e5dd894913fec728 (patch)
tree75e831fbb49ff6275d886d121393c9244aa0d885
parentcf99716e175b6380bde113f415477948d70bdbda (diff)
downloadlibtasn1-10b9817e978c37a8193dea17e5dd894913fec728.tar.gz
libtasn1-10b9817e978c37a8193dea17e5dd894913fec728.tar.bz2
libtasn1-10b9817e978c37a8193dea17e5dd894913fec728.zip
DER decoding: optimize tail seek by using the value providing by _asn1_append_sequence_set.
-rw-r--r--lib/decoding.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/decoding.c b/lib/decoding.c
index 199580c..5f5d55b 100644
--- a/lib/decoding.c
+++ b/lib/decoding.c
@@ -1292,9 +1292,7 @@ asn1_der_decoding (asn1_node * element, const void *ider, int ider_len,
if (!HAVE_TWO(ider_len) || ((der[counter]) || der[counter + 1]))
{
_asn1_append_sequence_set (p, &ptail);
- p = p->down;
- while (p->right)
- p = p->right;
+ p = ptail;
move = RIGHT;
continue;
}
@@ -1309,9 +1307,7 @@ asn1_der_decoding (asn1_node * element, const void *ider, int ider_len,
if (len2 > counter)
{
_asn1_append_sequence_set (p, &ptail);
- p = p->down;
- while (p->right)
- p = p->right;
+ p = ptail;
move = RIGHT;
continue;
}