Ver Fonte

bugfix in remap

Nicolas Cannasse há 9 anos atrás
pai
commit
10f2053133
1 ficheiros alterados com 2 adições e 0 exclusões
  1. 2 0
      src/std/maps.c

+ 2 - 0
src/std/maps.c

@@ -55,6 +55,7 @@ static void hl_hbremap( hl_bytes_map *m, uchar *key, int hash, vdynamic *value,
 		c->hashes[c->nvalues] = hash;
 		c->strings[c->nvalues] = key;
 		c->values[c->nvalues] = value;
+		c->nvalues++;
 		return;
 	}
 	c = *reuse;
@@ -472,6 +473,7 @@ static void hl_horemap( hl_obj_map *m, vdynamic *key, vdynamic *value, hl_obj_ce
 	if( c && c->nvalues < H_CELL_SIZE ) {
 		c->keys[c->nvalues] = key;
 		c->values[c->nvalues] = value;
+		c->nvalues++;
 		return;
 	}
 	c = *reuse;