[Exec](opt) Optimize function call for const columns (#18212)

This commit is contained in:
zclllyybb
2023-03-31 11:36:21 +08:00
committed by GitHub
parent e7bcd970f5
commit f800ba8f4c
12 changed files with 387 additions and 101 deletions

View File

@ -20,6 +20,8 @@
#include "string_ref.h"
#include "common/compiler_util.h"
namespace doris {
StringRef StringRef::trim() const {
@ -53,6 +55,19 @@ StringRef StringRef::max_string_val() {
return StringRef((char*)(&StringRef::MAX_CHAR), 1);
}
bool StringRef::start_with(char ch) const {
if (UNLIKELY(size == 0)) {
return false;
}
return data[0] == ch;
}
bool StringRef::end_with(char ch) const {
if (UNLIKELY(size == 0)) {
return false;
}
return data[size - 1] == ch;
}
bool StringRef::start_with(const StringRef& search_string) const {
DCHECK(size >= search_string.size);
if (search_string.size == 0) {