summaryrefslogtreecommitdiff
path: root/lib/int.h
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2012-09-23 12:55:40 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2012-09-23 12:56:03 +0200
commit80863f75dfa06b3a256760da86850bcc720a5e61 (patch)
treebee97dab1cc7f014d22a20ffba3a63f934946f5f /lib/int.h
parent086afe3375ee1fe3cda34c1b2302bdd6c95ebc0b (diff)
downloadlibtasn1-80863f75dfa06b3a256760da86850bcc720a5e61.tar.gz
libtasn1-80863f75dfa06b3a256760da86850bcc720a5e61.tar.bz2
libtasn1-80863f75dfa06b3a256760da86850bcc720a5e61.zip
improve performance by 50% by using hashes to compare strings.
Diffstat (limited to 'lib/int.h')
-rw-r--r--lib/int.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/int.h b/lib/int.h
index fad4dbe..9e6bc89 100644
--- a/lib/int.h
+++ b/lib/int.h
@@ -47,6 +47,7 @@ struct node_asn_struct
{
/* public fields: */
char name[ASN1_MAX_NAME_SIZE+1]; /* Node name */
+ unsigned int name_hash;
unsigned int type; /* Node type */
unsigned char *value; /* Node value */
int value_len;
@@ -63,6 +64,7 @@ struct node_asn_struct
#define _asn1_strcmp(a,b) strcmp((const char *)a, (const char *)b)
#define _asn1_strcpy(a,b) strcpy((char *)a, (const char *)b)
#define _asn1_strcat(a,b) strcat((char *)a, (const char *)b)
+uint32_t _asn1_bhash( const void *key, size_t length);
#define MAX_LOG_SIZE 1024 /* maximum number of characters of a log message */