dcapwell commented on code in PR #3815:
URL: https://github.com/apache/cassandra/pull/3815#discussion_r1924729490


##########
src/java/org/apache/cassandra/db/TypeSizes.java:
##########
@@ -47,19 +48,7 @@ public static int sizeof(String value)
 
     public static int encodedUTF8Length(String st)
     {
-        int strlen = st.length();
-        int utflen = 0;
-        for (int i = 0; i < strlen; i++)
-        {
-            int c = st.charAt(i);
-            if ((c >= 0x0001) && (c <= 0x007F))
-                utflen++;
-            else if (c > 0x07FF)
-                utflen += 3;
-            else
-                utflen += 2;
-        }
-        return utflen;
+        return ByteBufUtil.utf8Bytes(st);

Review Comment:
   our write is the Netty method, so why should our length logic be custom?



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