tpl_utils: Modified to avoid unnecessary loop. 99/185499/1
authorJoonbum Ko <joonbum.ko@samsung.com>
Tue, 31 Jul 2018 07:18:09 +0000 (16:18 +0900)
committerJoonbum Ko <joonbum.ko@samsung.com>
Tue, 31 Jul 2018 07:18:09 +0000 (16:18 +0900)
Change-Id: I8a63c27414b50e19b5425771d726e1c6fbeb8400
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
src/tpl_utils.h

index 4237247..7f55fec 100644 (file)
@@ -592,6 +592,7 @@ __tpl_list_find_node(tpl_list_t *list, void *data, int occurrence,
 
                        if (curr->data == data) {
                                res_node = curr;
+                               break;
                        }
                }
        } else if (occurrence == TPL_LAST) {
@@ -608,6 +609,7 @@ __tpl_list_find_node(tpl_list_t *list, void *data, int occurrence,
 
                        if (curr->data == data) {
                                res_node = curr;
+                               break;
                        }
                }
        }