diff --git a/simap.h b/simap.h index 29e831d..c6b6a99 100644 --- a/simap.h +++ b/simap.h @@ -109,7 +109,7 @@ static inline void* simap(void *amap_instance, AMAP_OP op, const char *key, void // TODO: We can possibly hand-optimise this with intrinsics maybe - but I hope autovectorization (does not seem to happen???) static inline SM_ALWAYS_INLINE auint64 *make_tipp(auint64 *tip, auint64 prefix, auint64 *end) { #pragma GCC unroll 4 - while((tip < end) && (*tip != prefix)) ++tip; + while((++tip < end) && (*tip != prefix)); return tip; } @@ -138,7 +138,7 @@ static inline simap_ptr64 *simap_search_internal(simap_instance *map, const char if(!is_smallkey) { char *tippremains = (char *)((uint8_t *)tipp + sizeof(uint64_t)); if(strcmp(keyremains, tippremains) != 0) { - tipp = make_tipp(tipp + 1, prefix.u64, end); + tipp = make_tipp(tipp, prefix.u64, end); continue; } } @@ -160,7 +160,7 @@ static inline simap_ptr64 *simap_search_internal(simap_instance *map, const char + sizeof(uint32_t)); if(retipp != tipp) { - tipp = make_tipp(tipp + 1, prefix.u64, end); + tipp = make_tipp(tipp, prefix.u64, end); continue; }