q66 pushed a commit to branch master.

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

commit e9811c659677e23b015b2980c0bd10dfb82c7e40
Author: Daniel Kolesa <d.kol...@osg.samsung.com>
Date:   Wed Apr 11 14:58:41 2018 +0200

    eolian: simplify class validation logic
---
 src/lib/eolian/database_validate.c | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/src/lib/eolian/database_validate.c 
b/src/lib/eolian/database_validate.c
index 4e309a52da..f065584f82 100644
--- a/src/lib/eolian/database_validate.c
+++ b/src/lib/eolian/database_validate.c
@@ -661,6 +661,10 @@ _db_fill_inherits(Eolian_Class *cl, Eina_Hash *fhash)
    if (eina_hash_find(fhash, cl->base.name))
      return EINA_TRUE;
 
+   /* already merged outside of staging, therefore validated, and skipped */
+   if (eina_hash_find(cl->base.unit->state->main.unit.classes, cl->base.name))
+     return EINA_TRUE;
+
    Eina_List *il = cl->inherits;
    Eina_Stringshare *inn = NULL;
    cl->inherits = NULL;
@@ -684,16 +688,11 @@ _db_fill_inherits(Eolian_Class *cl, Eina_Hash *fhash)
         else
           {
              cl->inherits = eina_list_append(cl->inherits, icl);
-             /* if the inherited class is already merged outside of staging,
-              * it's ok to skip it because it's already filled and validated
-              */
-             Eolian_Class *vcl = eina_hash_find(
-               cl->base.unit->state->main.unit.classes, inn);
              /* fill if not found, but do not return right away because
               * the rest of the list needs to be freed in order not to
               * leak any memory
               */
-             if (!vcl && !_db_fill_inherits(icl, fhash))
+             if (!_db_fill_inherits(icl, fhash))
                succ = EINA_FALSE;
           }
         eina_stringshare_del(inn);
@@ -866,11 +865,6 @@ database_validate(const Eolian_Unit *src)
    Eina_Hash *fhash = eina_hash_stringshared_new(NULL);
    EINA_ITERATOR_FOREACH(iter, cl)
      {
-        /* can skip classes that have already been merged and validated */
-        Eolian_Class *vcl = eina_hash_find(
-          cl->base.unit->state->main.unit.classes, cl->base.name);
-        if (vcl)
-          continue;
         if (!_db_fill_inherits(cl, fhash))
           {
              eina_hash_free(fhash);

-- 


Reply via email to