[Exec](opt) Optimize function call for const columns (#18212)
This commit is contained in:
@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user