github-actions[bot] commented on code in PR #28556: URL: https://github.com/apache/doris/pull/28556#discussion_r1438670934
########## be/src/vec/runtime/ipv4_value.h: ########## @@ -70,6 +79,23 @@ class IPv4Value { return {buf, len}; } + static bool is_valid_string(const char* ipv4_str, size_t len) { + if (len == 0) { + return false; + } + int64_t parse_value; + size_t begin = 0; + size_t end = len - 1; + while (begin < len && std::isspace(ipv4_str[begin])) { + ++begin; + } + while (end > begin && std::isspace(ipv4_str[end])) { + --end; + } + return vectorized::parseIPv4whole(ipv4_str + begin, ipv4_str + end + 1, + reinterpret_cast<unsigned char*>(&parse_value)); + } Review Comment: warning: redundant boolean literal in conditional return statement [readability-simplify-boolean-expr] be/src/vec/runtime/ipv4_value.h:94: ```diff - if (!vectorized::parseIPv4whole(ipv4_str + begin, ipv4_str + end + 1, - reinterpret_cast<unsigned char*>(&parse_value))) { - return false; - } - return true; + return vectorized::parseIPv4whole(ipv4_str + begin, ipv4_str + end + 1, + reinterpret_cast<unsigned char*>(&parse_value)); ``` -- 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. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org