[Refactor]Merged string_value into string_ref (#15925)

This commit is contained in:
ZhaoChangle
2023-01-22 16:39:23 +08:00
committed by GitHub
parent b9872ceb98
commit 199d7d3be8
133 changed files with 1485 additions and 1607 deletions

View File

@ -93,7 +93,7 @@ struct StringUtf8LengthImpl {
for (int i = 0; i < size; ++i) {
const char* raw_str = reinterpret_cast<const char*>(&data[offsets[i - 1]]);
int str_size = offsets[i] - offsets[i - 1];
res[i] = get_char_len(StringValue(raw_str, str_size), str_size);
res[i] = get_char_len(StringRef(raw_str, str_size), str_size);
}
return Status::OK();
}
@ -186,8 +186,8 @@ struct InStrOP {
return;
}
StringValue str_sv(strl.data(), strl.length());
StringValue substr_sv(strr.data(), strr.length());
StringRef str_sv(strl.data(), strl.length());
StringRef substr_sv(strr.data(), strr.length());
StringSearch search(&substr_sv);
// Hive returns positions starting from 1.
int loc = search.search(&str_sv);