diff options
| author | 2016-05-12 02:32:55 +0200 | |
|---|---|---|
| committer | 2016-05-12 02:32:55 +0200 | |
| commit | 2af7318239c59555869d018bc355fe0e21d900c6 (patch) | |
| tree | 3b366f10c04d305c9bd72e31e28ca62596ba07dd /src/hashtable.h | |
| parent | 6ab7e301f1854fd18891ddfeaa64e7485be990ba (diff) | |
| download | libplist-2af7318239c59555869d018bc355fe0e21d900c6.tar.gz libplist-2af7318239c59555869d018bc355fe0e21d900c6.tar.bz2 | |
bplist: Speed up plist_to_bin conversion for large plists
Using a better hashing algorithm and a larger hash table the conversion
is A LOT faster when processing large plists. Thanks to Xiao Deng for
reporting this issue and suggesting a fix.
Diffstat (limited to 'src/hashtable.h')
| -rw-r--r-- | src/hashtable.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/hashtable.h b/src/hashtable.h index c28de91..60a40ab 100644 --- a/src/hashtable.h +++ b/src/hashtable.h | |||
| @@ -32,7 +32,7 @@ typedef unsigned int(*hash_func_t)(const void* key); | |||
| 32 | typedef int (*compare_func_t)(const void *a, const void *b); | 32 | typedef int (*compare_func_t)(const void *a, const void *b); |
| 33 | 33 | ||
| 34 | typedef struct hashtable_t { | 34 | typedef struct hashtable_t { |
| 35 | hashentry_t *entries[256]; | 35 | hashentry_t *entries[4096]; |
| 36 | size_t count; | 36 | size_t count; |
| 37 | hash_func_t hash_func; | 37 | hash_func_t hash_func; |
| 38 | compare_func_t compare_func; | 38 | compare_func_t compare_func; |
