summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2017-10-30 16:28:21 -0200
committerSangHyeon Jade Lee <dltkdgus1764@gmail.com>2017-11-15 17:06:45 +0900
commit765cdd9e2413c6e7673a6178d3a3bee954e7096b (patch)
tree60f015567b7d1f290df6757a4abb14202693aa93
parent236bee625afe63eaed56aed5803ecd715b1608a1 (diff)
elm: Remove unused code in efl_ui_list_segarray.c
-rw-r--r--src/lib/elementary/efl_ui_list_segarray.c133
1 files changed, 18 insertions, 115 deletions
diff --git a/src/lib/elementary/efl_ui_list_segarray.c b/src/lib/elementary/efl_ui_list_segarray.c
index d5bd1ae910..71b61971bd 100644
--- a/src/lib/elementary/efl_ui_list_segarray.c
+++ b/src/lib/elementary/efl_ui_list_segarray.c
@@ -86,7 +86,6 @@ void efl_ui_list_segarray_setup(Efl_Ui_List_SegArray* segarray, //int member_siz
86 int initial_step_size) 86 int initial_step_size)
87{ 87{
88 segarray->root = NULL; 88 segarray->root = NULL;
89 /* segarray->member_size = member_size; */
90 segarray->array_initial_size = initial_step_size; 89 segarray->array_initial_size = initial_step_size;
91} 90}
92 91
@@ -115,74 +114,32 @@ void efl_ui_list_segarray_insert_accessor(Efl_Ui_List_SegArray* segarray, int fi
115 array_first = first_node->first; 114 array_first = first_node->first;
116 eina_iterator_free(pre_iterator); 115 eina_iterator_free(pre_iterator);
117 } 116 }
118 /* { */
119 /* Eina_Iterator* post_iterator = eina_rbtree_iterator_postfix(segarray->root); */
120 /* if(!eina_iterator_next(post_iterator, (void**)&last_node)) */
121 /* last_node = NULL; */
122 /* eina_iterator_free(post_iterator); */
123 /* } */
124 } 117 }
125 118
126 EINA_ACCESSOR_FOREACH(accessor, i, children) 119 EINA_ACCESSOR_FOREACH(accessor, i, children)
127 { 120 {
128 // if prefix'ing 121 Efl_Ui_List_SegArray_Node *node;
129 if((first + i < array_first) || !efl_ui_list_segarray_count(segarray)) 122 int idx = first + i;
123
124 DBG("insert is in the middle or at the end");
125
126 node = (void*)eina_rbtree_inline_lookup(EINA_RBTREE_GET(segarray->root),
127 &idx, sizeof(idx), &_insert_lookup_cb, NULL);
128 if(node)
130 { 129 {
131 // count is zero 130 assert(node->length < node->max);
132 DBG("prefixing count: %d", efl_ui_list_segarray_count(segarray)); 131 node->pointers[node->length] = _create_item(children, first + i);
133 // if no first_node 132 node->length++;
134 if(!first_node) 133 segarray->count++;
135 {
136 first_node = _alloc_node(segarray, i + first, segarray->array_initial_size);
137 first_node->pointers[0] = _create_item(children, first + i);
138 first_node->length++;
139 segarray->count++;
140 }
141 else
142 {
143 DBG("there is a first node");
144 }
145 /* else if() */
146 /* { */
147
148 /* } */
149 } 134 }
150 else if(first + i <= array_first + efl_ui_list_segarray_count(segarray)) 135 else
151 { 136 {
152 Efl_Ui_List_SegArray_Node *node; 137 DBG("no node to add item for index %d!", i + first);
153 int idx = first + i; 138 node = _alloc_node(segarray, i + first, segarray->array_initial_size);
154 139 node->pointers[0] = _create_item(children, first + i);
155 DBG("insert is in the middle"); 140 node->length++;
156 141 segarray->count++;
157 node = (void*)eina_rbtree_inline_lookup(EINA_RBTREE_GET(segarray->root),
158 &idx, sizeof(idx), &_insert_lookup_cb, NULL);
159 if(node)
160 {
161 assert(node->length < node->max);
162 node->pointers[node->length] = _create_item(children, first + i);
163 node->length++;
164 segarray->count++;
165 }
166 else
167 {
168 DBG("no node to add item for index %d!", i + first);
169 node = _alloc_node(segarray, i + first, segarray->array_initial_size);
170 node->pointers[0] = _create_item(children, first + i);
171 node->length++;
172 segarray->count++;
173 }
174 } 142 }
175 /* else // suffix'ing */
176 /* { */
177 /* DBG("suffixing"); */
178 /* assert(!!last_node == !!first_node); */
179 /* if(last_node->max < last_node->length) */
180 /* { */
181 /* last_node->pointers[last_node->length++] = _create_item(children, first + i); */
182 /* ++last_node->length; */
183 /* segarray->count++; */
184 /* } */
185 /* } */
186 } 143 }
187} 144}
188 145
@@ -271,57 +228,3 @@ Eina_Accessor* efl_ui_list_segarray_accessor_get(Efl_Ui_List_SegArray* segarray)
271 _efl_ui_list_segarray_accessor_setup(acc, segarray); 228 _efl_ui_list_segarray_accessor_setup(acc, segarray);
272 return &acc->vtable; 229 return &acc->vtable;
273} 230}
274
275/* static void */
276/* _insert(int pos, Efl_Model* model) */
277/* { */
278/* Efl_Ui_List_Item* item = malloc(sizeof(Efl_Ui_List_Item)); */
279/* item->model = model; */
280
281
282/* } */
283
284/* inline static Efl_Ui_List_Item** */
285/* _back_empty_get_or_null(Efl_Ui_List_SegArray* array) */
286/* { */
287/* /\* void* inlist_last = eina_rbtree_last(array->list); *\/ */
288/* /\* Efl_Ui_List_SegArray_Node* node = inlist_last; *\/ */
289/* /\* if(node && node->max == node->length) *\/ */
290/* /\* return &node->pointers[node->length++]; *\/ */
291/* /\* else *\/ */
292/* return NULL; */
293/* } */
294
295/* inline static Efl_Ui_List_Item** */
296/* _alloc_back_and_return_last(Efl_Ui_List_SegArray* array) */
297/* { */
298/* Efl_Ui_List_SegArray_Node* new_node = calloc(1, sizeof(Efl_Ui_List_SegArray_Node) + array->array_initial_size); */
299/* new_node->length = 0; */
300/* new_node->max = array->array_initial_size; */
301
302/* array->list = eina_inlist_append(array->list, EINA_INLIST_GET(new_node)); */
303/* return &new_node->pointers[0]; */
304/* } */
305
306
307/* /\* void efl_ui_list_segarray_insert_at_index(Efl_Ui_List_SegArray* array EINA_UNUSED, int index EINA_UNUSED, *\/ */
308/* /\* Efl_Ui_List_Item* item EINA_UNUSED) *\/ */
309/* /\* { *\/ */
310
311/* /\* } *\/ */
312
313/* void efl_ui_list_segarray_append(Efl_Ui_List_SegArray* array, Efl_Ui_List_Item* item) */
314/* { */
315/* Efl_Ui_List_Item** new_item = _back_empty_get_or_null(array); */
316/* if(!new_item) */
317/* new_item = _alloc_back_and_return_last(array); */
318
319/* *new_item = item; */
320/* } */
321
322/* /\* void efl_ui_list_segarray_insert_at(Efl_Ui_List_SegArray* array, int position, Efl_Ui_List_Item* item) *\/ */
323/* /\* { *\/ */
324
325/* /\* } *\/ */
326
327