rimmed pushed a commit to branch master.

http://git.enlightenment.org/tools/eflete.git/commit/?id=83983eecd70b02fec78c2c5d6ebc1da16f9e0812

commit 83983eecd70b02fec78c2c5d6ebc1da16f9e0812
Author: Vyacheslav Reutskiy <[email protected]>
Date:   Mon Feb 6 11:46:23 2017 +0200

    widget_list: optimize string usage
    
    Have not needs to use stringshare for short time save a string slice,
    in curent case it parced prefix of full group name.
    
    @optimize
    
    Change-Id: I0e2cb256ada789a03489b5866ff669d3ea1ab438
---
 src/bin/common/widget_list.c | 8 ++++----
 src/bin/common/widget_list.h | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/bin/common/widget_list.c b/src/bin/common/widget_list.c
index 476be64..e8219b3 100644
--- a/src/bin/common/widget_list.c
+++ b/src/bin/common/widget_list.c
@@ -408,7 +408,7 @@ widget_prefix_list_get(Eina_List *collections, const char 
*widget_name, const ch
    return list;
 }
 
-Eina_Stringshare *
+char *
 widget_prefix_get(const char *group_name, int level, int *symbols)
 {
    const char *pos;
@@ -430,7 +430,7 @@ widget_prefix_get(const char *group_name, int level, int 
*symbols)
    prefix[len] = '\0';
    if (symbols) *symbols = len;
 
-   return eina_stringshare_add(prefix);
+   return strdup(prefix);
 }
 
 void
@@ -444,7 +444,7 @@ widget_tree_items_get(Eina_List *groups,
    const char *pos;
    Group2 *group, *group_next;
    size_t prefix_len;
-   Eina_Stringshare *group_prefix;
+   char *group_prefix;
    int group_prefix_len;
    Eina_List *l, *lnext;
 
@@ -494,6 +494,6 @@ widget_tree_items_get(Eina_List *groups,
           {
              *groups_out = eina_list_append(*groups_out, group);
           }
-        eina_stringshare_del(group_prefix);
+        free(group_prefix);
      }
 }
diff --git a/src/bin/common/widget_list.h b/src/bin/common/widget_list.h
index 23a9ba5..3e9789a 100644
--- a/src/bin/common/widget_list.h
+++ b/src/bin/common/widget_list.h
@@ -46,7 +46,7 @@ Eina_List *widget_prefix_list_get(Eina_List *collections, 
const char *widget_nam
  * @param level The depth of prefix;
  * @param len The lenght of finded prefix.
  */
-Eina_Stringshare *
+char *
 widget_prefix_get(const char *group_name, int level, int *len);
 
 /*

-- 


Reply via email to