summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2018-01-31 19:14:15 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2018-01-31 19:14:15 +0100
commita6d0e787e4f8695cd1269a4af716e419c8c40133 (patch)
treec77bf00d9ca175db11e7b8e8206bce128cb46ebc
parent8b1f2f34b4688249a9697ced7f7d25f7bcee2bea (diff)
eolian: no need to store 'parsed' table anymore either
-rw-r--r--src/lib/eolian/eo_parser.c30
-rw-r--r--src/lib/eolian/eolian_database.c6
-rw-r--r--src/lib/eolian/eolian_database.h2
3 files changed, 14 insertions, 24 deletions
diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c
index 9ad7fd9874..85ba8c2320 100644
--- a/src/lib/eolian/eo_parser.c
+++ b/src/lib/eolian/eo_parser.c
@@ -2245,22 +2245,19 @@ parse_chunk(Eo_Lexer *ls, Eina_Bool eot)
2245Eolian_Unit * 2245Eolian_Unit *
2246eo_parser_database_fill(Eolian_Unit *parent, const char *filename, Eina_Bool eot) 2246eo_parser_database_fill(Eolian_Unit *parent, const char *filename, Eina_Bool eot)
2247{ 2247{
2248 Eolian_Unit *ret = NULL; 2248 const char *fsl = strrchr(filename, '/');
2249 if (eina_hash_find(parent->state->parsed, filename)) 2249 const char *bsl = strrchr(filename, '\\');
2250 { 2250 const char *fname = NULL;
2251 const char *fsl = strrchr(filename, '/'); 2251 if (fsl || bsl)
2252 const char *bsl = strrchr(filename, '\\'); 2252 fname = eina_stringshare_add((fsl > bsl) ? (fsl + 1) : (bsl + 1));
2253 const char *fname = NULL; 2253 else
2254 if (fsl || bsl) 2254 fname = eina_stringshare_add(filename);
2255 fname = eina_stringshare_add((fsl > bsl) ? (fsl + 1) : (bsl + 1)); 2255
2256 if (fname) 2256 Eolian_Unit *ret = eina_hash_find(parent->state->units, fname);
2257 { 2257 eina_stringshare_del(fname);
2258 ret = eina_hash_find(parent->state->units, fname); 2258
2259 eina_stringshare_del(fname); 2259 if (ret)
2260 return ret; 2260 return ret;
2261 }
2262 return NULL;
2263 }
2264 2261
2265 Eo_Lexer *ls = eo_lexer_new(parent->state, filename); 2262 Eo_Lexer *ls = eo_lexer_new(parent->state, filename);
2266 if (!ls) 2263 if (!ls)
@@ -2292,7 +2289,6 @@ eo_parser_database_fill(Eolian_Unit *parent, const char *filename, Eina_Bool eot
2292 2289
2293done: 2290done:
2294 ret = ls->unit; 2291 ret = ls->unit;
2295 eina_hash_set(ls->state->parsed, filename, (void *)EINA_TRUE);
2296 eina_hash_add(parent->children, filename, ret); 2292 eina_hash_add(parent->children, filename, ret);
2297 2293
2298 eo_lexer_free(ls); 2294 eo_lexer_free(ls);
diff --git a/src/lib/eolian/eolian_database.c b/src/lib/eolian/eolian_database.c
index 93aba59d38..5071c0562f 100644
--- a/src/lib/eolian/eolian_database.c
+++ b/src/lib/eolian/eolian_database.c
@@ -550,9 +550,7 @@ eolian_new(void)
550 state->filenames_eo = eina_hash_string_small_new(free); 550 state->filenames_eo = eina_hash_string_small_new(free);
551 state->filenames_eot = eina_hash_string_small_new(free); 551 state->filenames_eot = eina_hash_string_small_new(free);
552 552
553 state->parsed = eina_hash_string_small_new(NULL); 553 state->defer = eina_hash_string_small_new(NULL);
554 state->defer = eina_hash_string_small_new(NULL);
555
556 state->units = eina_hash_stringshared_new(EINA_FREE_CB(database_unit_del)); 554 state->units = eina_hash_stringshared_new(EINA_FREE_CB(database_unit_del));
557 555
558 state->classes_f = eina_hash_stringshared_new(NULL); 556 state->classes_f = eina_hash_stringshared_new(NULL);
@@ -577,9 +575,7 @@ eolian_free(Eolian *state)
577 eina_hash_free(state->filenames_eo); 575 eina_hash_free(state->filenames_eo);
578 eina_hash_free(state->filenames_eot); 576 eina_hash_free(state->filenames_eot);
579 577
580 eina_hash_free(state->parsed);
581 eina_hash_free(state->defer); 578 eina_hash_free(state->defer);
582
583 eina_hash_free(state->units); 579 eina_hash_free(state->units);
584 580
585 eina_hash_free(state->classes_f); 581 eina_hash_free(state->classes_f);
diff --git a/src/lib/eolian/eolian_database.h b/src/lib/eolian/eolian_database.h
index a26b4af560..5811e93cad 100644
--- a/src/lib/eolian/eolian_database.h
+++ b/src/lib/eolian/eolian_database.h
@@ -51,9 +51,7 @@ struct _Eolian
51 Eina_Hash *filenames_eo; /* filename to full path mapping */ 51 Eina_Hash *filenames_eo; /* filename to full path mapping */
52 Eina_Hash *filenames_eot; 52 Eina_Hash *filenames_eot;
53 53
54 Eina_Hash *parsed;
55 Eina_Hash *defer; 54 Eina_Hash *defer;
56
57 Eina_Hash *units; 55 Eina_Hash *units;
58 56
59 Eina_Hash *classes_f; 57 Eina_Hash *classes_f;