3 #ifndef IMPALA_EXPERIMENTS_STRING_SEARCH_SSE_H
4 #define IMPALA_EXPERIMENTS_STRING_SEARCH_SSE_H
53 char last_char_haystack = haystack.
ptr[haystack.
len - 1];
54 haystack.
ptr[haystack.
len - 1] =
'\0';
59 char* s = strchr(haystack.
ptr, c);
61 result = s - haystack.
ptr;
62 }
else if (last_char_haystack == c) {
63 result = haystack.
len - 1;
66 haystack.
ptr[haystack.
len - 1] = last_char_haystack;
76 haystack.
ptr[haystack.
len - 1] = last_char_haystack;
79 result = s - haystack.
ptr;
99 char* haystack_pos = haystack.
ptr;
105 if (search == NULL)
break;
107 offset += (search - haystack_pos);
114 if (last_char_needle == last_char_haystack) result =
offset;
126 haystack_pos = search + 1;
133 haystack.
ptr[haystack.
len - 1] = last_char_haystack;
StringSearchSSE(const StringValue *needle)
const StringValue * needle_str_val_
Only one of these two will be non-null. Both are unowned.
const char * needle_cstr_
StringSearchSSE(const char *needle)
int Search(const StringValue &haystack) const
uint8_t offset[7 *64-sizeof(uint64_t)]