zclllyybb commented on code in PR #22364:
URL: https://github.com/apache/doris/pull/22364#discussion_r1279224402


##########
be/src/util/string_parser.hpp:
##########
@@ -624,27 +624,29 @@ T StringParser::string_to_decimal(const char* s, int len, 
int type_precision, in
     }
 
     int precision = 0;
+    int max_digit = type_precision - type_scale;
     bool found_exponent = false;
     int8_t exponent = 0;
     T value = 0;
     for (int i = 0; i < len; ++i) {
         const char& c = s[i];
-        if (LIKELY('0' <= c && c <= '9')) {
+        if (found_dot && max_digit < (precision - scale)) {

Review Comment:
   why `found_dot` here? maybe `!found_dot` here is right. And maybe place this 
judgement after precisions' increments rather than the front of loop body will 
be more efficient.



-- 
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

Reply via email to