Page MenuHomePhabricator

edje/optimization: Avoid string duplication when possible.
Needs RevisionPublic

Authored by smohanty on Wed, Jun 17, 2:48 AM.

Details

Summary

Most use case the part name dosen't contain the recursive name
so we don't have to go through expensive eina_string_split operation.

Diff Detail

Repository
rEFL core/efl
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 17014
Build 11319: arc lint + arc unit
smohanty created this revision.Wed, Jun 17, 2:48 AM

It seems that this patch has no reviewers specified. If you are unsure who can review your patch, please check this wiki page and see if anyone can be added: https://phab.enlightenment.org/w/maintainers_reviewers/

smohanty requested review of this revision.Wed, Jun 17, 2:48 AM
smohanty updated this revision to Diff 30673.

updated

CHAN added a subscriber: CHAN.EditedTue, Jun 23, 5:10 PM

@smohanty nice catch. let's listen cedric's opinion

@cedric i think we can change like below. how about it?

Edje_Real_Part *
_edje_real_part_recursive_get(Edje **ed, const char *part)
{
   Edje_Real_Part *rp;
   char **path;

   if ((*ed)->collection && (*ed)->collection->alias)
     {
        path = eina_str_split(part, EDJE_PART_PATH_SEPARATOR_STRING, 0);
        if (!path) return NULL;

        rp = _edje_real_part_recursive_get_helper(ed, path);

        free(*path);
        free(path);
        return rp;
     }
   return _edje_real_part_get(*ed, part);;
}
CHAN added a comment.Mon, Jul 6, 4:58 PM

Plz review https://phab.enlightenment.org/D12045 instead of this patch.

raster requested changes to this revision.Tue, Jul 7, 3:21 AM
raster added a subscriber: raster.

can you abandon this then?

This revision now requires changes to proceed.Tue, Jul 7, 3:21 AM