jacktengg commented on code in PR #54760:
URL: https://github.com/apache/doris/pull/54760#discussion_r2282381359


##########
be/src/util/mysql_row_buffer.cpp:
##########
@@ -179,10 +179,8 @@ static char* add_largeint(int128_t data, char* pos, bool 
dynamic_mode) {
 
 template <typename T>
 char* add_float(T data, char* pos, bool dynamic_mode) {
-    int length = 0;
-    if constexpr (std::is_same_v<T, float> || std::is_same_v<T, double>) {
-        length = fast_to_buffer(data, pos + !dynamic_mode);
-    }
+    static_assert(std::is_same_v<T, float> || std::is_same_v<T, double>);
+    int length = fast_to_buffer(data, pos + !dynamic_mode);

Review Comment:
   这里是直接往add_float的入参`pos`里面写入字符串,可以避免多余的拷贝。



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to