diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2012-09-23 12:55:40 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2012-09-23 12:56:03 +0200 |
commit | 80863f75dfa06b3a256760da86850bcc720a5e61 (patch) | |
tree | bee97dab1cc7f014d22a20ffba3a63f934946f5f /lib/int.h | |
parent | 086afe3375ee1fe3cda34c1b2302bdd6c95ebc0b (diff) | |
download | libtasn1-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.h | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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 */ |