summaryrefslogtreecommitdiff
path: root/src/bin/evas/evas_cserve2_index.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/evas/evas_cserve2_index.c')
-rw-r--r--src/bin/evas/evas_cserve2_index.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/bin/evas/evas_cserve2_index.c b/src/bin/evas/evas_cserve2_index.c
index 2c4d9dc15b..ce5b93a6fe 100644
--- a/src/bin/evas/evas_cserve2_index.c
+++ b/src/bin/evas/evas_cserve2_index.c
@@ -550,11 +550,15 @@ _shared_index_entry_get_by_id(Shared_Index *si, unsigned int id)
550 obj = (Index_Entry *) (base + (elemsize * id)); 550 obj = (Index_Entry *) (base + (elemsize * id));
551 if (obj->id == id) 551 if (obj->id == id)
552 return obj; 552 return obj;
553 if (obj->id < id)
554 low = id + 1;
555 else
556 high = id;
553 } 557 }
554 558
555 // Binary search 559 // Binary search
556 start_high = high; 560 start_high = high;
557 while(high != low) 561 while(high > low)
558 { 562 {
559 cur = low + ((high - low) / 2); 563 cur = low + ((high - low) / 2);
560 obj = (Index_Entry *) (base + (elemsize * cur)); 564 obj = (Index_Entry *) (base + (elemsize * cur));