kangpinghuang commented on a change in pull request #3638:
URL: https://github.com/apache/incubator-doris/pull/3638#discussion_r428551712
##########
File path: be/src/exprs/string_functions.cpp
##########
@@ -49,6 +49,17 @@ size_t get_utf8_byte_length(unsigned char byte) {
}
return char_size;
}
+size_t get_char_len(const StringVal& str, std::vector<size_t>* str_index) {
+ size_t char_len = 0;
+ size_t byte_pos = 0;
+ for (size_t i = 0, char_size = 0; i < str.len; i += char_size) {
Review comment:
```suggestion
for (size_t i = 0; i < str.len; i += char_size) {
```
##########
File path: be/src/exprs/string_functions.cpp
##########
@@ -49,6 +49,17 @@ size_t get_utf8_byte_length(unsigned char byte) {
}
return char_size;
}
+size_t get_char_len(const StringVal& str, std::vector<size_t>* str_index) {
+ size_t char_len = 0;
+ size_t byte_pos = 0;
+ for (size_t i = 0, char_size = 0; i < str.len; i += char_size) {
+ char_size = get_utf8_byte_length((unsigned)(str.ptr)[i]);
+ str_index->push_back(byte_pos);
Review comment:
just use i to replace byte_pos and remove byte_pos
##########
File path: be/src/exprs/string_functions.cpp
##########
@@ -49,6 +49,17 @@ size_t get_utf8_byte_length(unsigned char byte) {
}
return char_size;
}
+size_t get_char_len(const StringVal& str, std::vector<size_t>* str_index) {
+ size_t char_len = 0;
+ size_t byte_pos = 0;
Review comment:
can remove this variable
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]