Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

minor fix : map alloc 1.5x slot

  • Loading branch information...
commit c79e770e138827fb58a9a7eebc1b1478509b17cb 1 parent 5788c2f
@cloudwu authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  map.c
View
2  map.c
@@ -17,10 +17,10 @@ struct map {
struct map *
map_new(int max) {
int sz = 1;
+ max = max * 3 / 2;
while (sz <= max) {
sz *= 2;
}
- sz *= 2;
struct map * m = malloc(sizeof(*m));
m->size = sz;
m->hash = malloc(sizeof(struct node) * sz);
Please sign in to comment.
Something went wrong with that request. Please try again.