hermet pushed a commit to branch master.

http://git.enlightenment.org/tools/enventor.git/commit/?id=1eae9775083ddca2f07536532eee8eac82de13ae

commit 1eae9775083ddca2f07536532eee8eac82de13ae
Author: ChunEon Park <her...@hermet.pe.kr>
Date:   Tue Aug 26 11:37:34 2014 +0900

    edc_parser: code refactoring.
    
    be simpler code.
---
 src/bin/edc_parser.c | 42 ++++++++++++++----------------------------
 1 file changed, 14 insertions(+), 28 deletions(-)

diff --git a/src/bin/edc_parser.c b/src/bin/edc_parser.c
index 2543e87..6b363de 100644
--- a/src/bin/edc_parser.c
+++ b/src/bin/edc_parser.c
@@ -745,24 +745,17 @@ parser_cur_group_name_get(parser_data *pd, Evas_Object 
*entry,
 {
    if (pd->thread) ecore_thread_cancel(pd->thread);
 
-   cur_name_td *td = calloc(1, sizeof(cur_name_td));
-   if (!td)
-     {
-        EINA_LOG_ERR("Failed to allocate Memory!");
-        return;
-     }
-
    const char *text = elm_entry_entry_get(entry);
-   if (!text)
-     {
-        free(td);
-        return;
-     }
+   if (!text) return;
 
    char *utf8 = elm_entry_markup_to_utf8(text);
-   if (!utf8)
+   if (!utf8) return;
+
+   cur_name_td *td = calloc(1, sizeof(cur_name_td));
+   if (!td)
      {
-        free(td);
+        free(utf8);
+        EINA_LOG_ERR("Failed to allocate Memory!");
         return;
      }
 
@@ -785,24 +778,17 @@ parser_cur_name_get(parser_data *pd, Evas_Object *entry, 
void (*cb)(void *data,
 {
    if (pd->thread) ecore_thread_cancel(pd->thread);
 
-   cur_name_td *td = calloc(1, sizeof(cur_name_td));
-   if (!td)
-     {
-        EINA_LOG_ERR("Failed to allocate Memory!");
-        return;
-     }
-
    const char *text = elm_entry_entry_get(entry);
-   if (!text)
-     {
-        free(td);
-        return;
-     }
+   if (!text) return;
 
    char *utf8 = elm_entry_markup_to_utf8(text);
-   if (!utf8)
+   if (!utf8) return;
+
+   cur_name_td *td = calloc(1, sizeof(cur_name_td));
+   if (!td)
      {
-        free(td);
+        free(utf8);
+        EINA_LOG_ERR("Failed to allocate Memory!");
         return;
      }
 

-- 


Reply via email to