optimization on memory
This commit is contained in:
parent
0e3dd1a83f
commit
fe1de151ff
4 changed files with 14 additions and 5 deletions
11
src/loader.c
11
src/loader.c
|
@ -32,12 +32,15 @@ int load_elements(hashmap *m, char *table, int use_inv) {
|
|||
continue;
|
||||
}
|
||||
|
||||
char *combo = strstr(str, ";");
|
||||
combo[0] = '\0';
|
||||
combo++;
|
||||
char *combo_o = strstr(str, ";");
|
||||
combo_o[0] = '\0';
|
||||
combo_o++;
|
||||
|
||||
char *combo = calloc(strlen(combo_o)+1,sizeof(char));
|
||||
strcpy(combo,combo_o);
|
||||
|
||||
if (use_inv == 2) {
|
||||
hashmap_set(m, str, strlen(str) - 1, (uintptr_t)combo, 0);
|
||||
hashmap_set(m, str, strlen(str) - 1, (uintptr_t)combo, 1);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue