diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/evas/evas_cserve2_index.c | 8 | ||||
-rw-r--r-- | src/bin/evas/evas_cserve2_shm_debug.c | 8 | ||||
-rw-r--r-- | src/lib/evas/cserve2/evas_cs2_client.c | 8 |
3 files changed, 24 insertions, 0 deletions
diff --git a/src/bin/evas/evas_cserve2_index.c b/src/bin/evas/evas_cserve2_index.c index 699ef95064..816a686d23 100644 --- a/src/bin/evas/evas_cserve2_index.c +++ b/src/bin/evas/evas_cserve2_index.c | |||
@@ -544,6 +544,14 @@ _shared_index_entry_get_by_id(Shared_Index *si, unsigned int id) | |||
544 | base = si->sa->ds->data + sizeof(Shared_Array_Header); | 544 | base = si->sa->ds->data + sizeof(Shared_Array_Header); |
545 | elemsize = si->sa->header->elemsize; | 545 | elemsize = si->sa->header->elemsize; |
546 | 546 | ||
547 | // Direct access, works for non-repacked arrays | ||
548 | if ((int) id < high) | ||
549 | { | ||
550 | obj = (Index_Entry *) (base + (elemsize * id)); | ||
551 | if (obj->id == id) | ||
552 | return obj; | ||
553 | } | ||
554 | |||
547 | // Binary search | 555 | // Binary search |
548 | start_high = high; | 556 | start_high = high; |
549 | while(high != low) | 557 | while(high != low) |
diff --git a/src/bin/evas/evas_cserve2_shm_debug.c b/src/bin/evas/evas_cserve2_shm_debug.c index e17e5d2b40..bde62bd89b 100644 --- a/src/bin/evas/evas_cserve2_shm_debug.c +++ b/src/bin/evas/evas_cserve2_shm_debug.c | |||
@@ -286,6 +286,14 @@ _shared_index_item_get_by_id(Shm_File *si, int elemsize, unsigned int id) | |||
286 | 286 | ||
287 | base = si->data + sizeof(Shared_Array_Header); | 287 | base = si->data + sizeof(Shared_Array_Header); |
288 | 288 | ||
289 | // Direct access, works for non-repacked arrays | ||
290 | if ((int) id < high) | ||
291 | { | ||
292 | obj = (Shm_Object *) (base + (elemsize * id)); | ||
293 | if (obj->id == id) | ||
294 | return obj; | ||
295 | } | ||
296 | |||
289 | // Binary search | 297 | // Binary search |
290 | start_high = high; | 298 | start_high = high; |
291 | while(high != low) | 299 | while(high != low) |
diff --git a/src/lib/evas/cserve2/evas_cs2_client.c b/src/lib/evas/cserve2/evas_cs2_client.c index 5721d0bd69..9bcf966339 100644 --- a/src/lib/evas/cserve2/evas_cs2_client.c +++ b/src/lib/evas/cserve2/evas_cs2_client.c | |||
@@ -1929,6 +1929,14 @@ _shared_index_item_get_by_id(Shared_Index *si, int elemsize, unsigned int id) | |||
1929 | 1929 | ||
1930 | base = si->data + sizeof(Shared_Array_Header); | 1930 | base = si->data + sizeof(Shared_Array_Header); |
1931 | 1931 | ||
1932 | // Direct access, works for non-repacked arrays | ||
1933 | if ((int) id < high) | ||
1934 | { | ||
1935 | obj = (Shm_Object *) (base + (elemsize * id)); | ||
1936 | if (obj->id == id) | ||
1937 | return obj; | ||
1938 | } | ||
1939 | |||
1932 | // Binary search | 1940 | // Binary search |
1933 | start_high = high; | 1941 | start_high = high; |
1934 | while(high != low) | 1942 | while(high != low) |