File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -176,13 +176,14 @@ static art_node** find_child(art_node *n, unsigned char c) {
176
176
bitfield = _mm_movemask_epi8 (cmp ) & mask ;
177
177
#else
178
178
// Compare the key to all 16 stored keys
179
- unsigned bitfield = 0 ;
180
- for (short i = 0 ; i < 16 ; ++ i ) {
179
+ bitfield = 0 ;
180
+ for (i = 0 ; i < 16 ; ++ i ) {
181
181
if (p .p2 -> keys [i ] == c )
182
182
bitfield |= (1 << i );
183
183
}
184
184
185
185
// Use a mask to ignore children that don't exist
186
+ mask = (1 << n -> num_children ) - 1 ;
186
187
bitfield &= mask ;
187
188
#endif
188
189
#endif
@@ -354,7 +355,7 @@ art_leaf* art_maximum(art_tree *t) {
354
355
}
355
356
356
357
static art_leaf * make_leaf (const unsigned char * key , int key_len , void * value ) {
357
- art_leaf * l = (art_leaf * )malloc ( sizeof (art_leaf )+ key_len );
358
+ art_leaf * l = (art_leaf * )calloc ( 1 , sizeof (art_leaf )+ key_len );
358
359
l -> value = value ;
359
360
l -> key_len = key_len ;
360
361
memcpy (l -> key , key , key_len );
You can’t perform that action at this time.
0 commit comments