q66 pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=d5599521172af414beb63ad52d68830e0c6fa1f4

commit d5599521172af414beb63ad52d68830e0c6fa1f4
Author: Daniel Kolesa <d.kol...@osg.samsung.com>
Date:   Fri May 22 17:14:38 2015 +0100

    eolian: reuse the parsed eot hash for eo too (simplify code)
---
 src/lib/eolian/database_fill.c   |  5 ++---
 src/lib/eolian/eolian_database.c | 22 ++++------------------
 src/lib/eolian/eolian_database.h |  2 +-
 3 files changed, 7 insertions(+), 22 deletions(-)

diff --git a/src/lib/eolian/database_fill.c b/src/lib/eolian/database_fill.c
index d07b8d4..2d43b6c 100644
--- a/src/lib/eolian/database_fill.c
+++ b/src/lib/eolian/database_fill.c
@@ -218,7 +218,7 @@ eo_parser_database_fill(const char *filename, Eina_Bool eot)
    Eolian_Class *cl;
    Eo_Lexer *ls;
 
-   if (eot && eina_hash_find(_parsedeots, filename))
+   if (eina_hash_find(_parsedeos, filename))
      return EINA_TRUE;
 
    eina_hash_set(_parsingeos, filename, (void *)EINA_TRUE);
@@ -279,8 +279,7 @@ eo_parser_database_fill(const char *filename, Eina_Bool eot)
    eina_iterator_free(itr);
 
 done:
-   if (eot)
-     eina_hash_set(_parsedeots, filename, (void *)EINA_TRUE);
+   eina_hash_set(_parsedeos, filename, (void *)EINA_TRUE);
    eina_hash_set(_parsingeos, filename, (void *)EINA_FALSE);
 
    eo_lexer_free(ls);
diff --git a/src/lib/eolian/eolian_database.c b/src/lib/eolian/eolian_database.c
index 1b0fc06..5daa6d7 100644
--- a/src/lib/eolian/eolian_database.c
+++ b/src/lib/eolian/eolian_database.c
@@ -23,7 +23,7 @@ Eina_Hash *_filenames  = NULL;
 Eina_Hash *_tfilenames = NULL;
 Eina_Hash *_decls      = NULL;
 
-Eina_Hash *_parsedeots = NULL;
+Eina_Hash *_parsedeos  = NULL;
 Eina_Hash *_parsingeos = NULL;
 
 static int _database_init_count = 0;
@@ -54,7 +54,7 @@ database_init()
    _filenames  = eina_hash_string_small_new(free);
    _tfilenames = eina_hash_string_small_new(free);
    _decls      = eina_hash_stringshared_new(free);
-   _parsedeots = eina_hash_string_small_new(NULL);
+   _parsedeos  = eina_hash_string_small_new(NULL);
    _parsingeos = eina_hash_string_small_new(NULL);
    return ++_database_init_count;
 }
@@ -86,7 +86,7 @@ database_shutdown()
         eina_hash_free(_filenames ); _filenames  = NULL;
         eina_hash_free(_tfilenames); _tfilenames = NULL;
         eina_hash_free(_decls     ); _decls      = NULL;
-        eina_hash_free(_parsedeots); _parsedeots = NULL;
+        eina_hash_free(_parsedeos ); _parsedeos  = NULL;
         eina_hash_free(_parsingeos); _parsingeos = NULL;
         eina_shutdown();
      }
@@ -216,23 +216,9 @@ eolian_eot_file_parse(const char *filepath)
 EAPI Eina_Bool
 eolian_eo_file_parse(const char *filepath)
 {
-   char *bfiledup, *bfilename;
-
    if (_database_init_count <= 0)
      return EINA_FALSE;
-
-   bfiledup = strdup(filepath);
-   bfilename = basename(bfiledup);
-   if (!eolian_class_get_by_file(bfilename) && 
!eo_parser_database_fill(filepath, EINA_FALSE))
-     {
-        free(bfiledup);
-        goto error;
-     }
-   free(bfiledup);
-   return EINA_TRUE;
-
-error:
-   return EINA_FALSE;
+   return eo_parser_database_fill(filepath, EINA_FALSE);
 }
 
 static Eina_Bool _tfile_parse(const Eina_Hash *hash EINA_UNUSED, const void 
*key EINA_UNUSED, void *data, void *fdata)
diff --git a/src/lib/eolian/eolian_database.h b/src/lib/eolian/eolian_database.h
index 6783050..9bc76d4 100644
--- a/src/lib/eolian/eolian_database.h
+++ b/src/lib/eolian/eolian_database.h
@@ -50,7 +50,7 @@ extern Eina_Hash *_tfilenames;
 extern Eina_Hash *_decls;
 
 /* holds parsed/currently parsing eot files to keep track */
-extern Eina_Hash *_parsedeots;
+extern Eina_Hash *_parsedeos;
 extern Eina_Hash *_parsingeos;
 
 typedef struct _Eolian_Object

-- 


Reply via email to