cloud-fan commented on code in PR #45963:
URL: https://github.com/apache/spark/pull/45963#discussion_r1560355740


##########
common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java:
##########
@@ -1636,14 +1699,13 @@ public int levenshteinDistance(UTF8String other, int 
threshold) {
         } else if (i == min - 1) {
           num_bytes_i = 0;
         } else {
-          if (ByteArrayMethods.arrayEquals(t.base, t.offset + j_bytes,
-                  s.base, s.offset + i_bytes, num_bytes_j)) {
+          num_bytes_i = numBytesForFirstByte(s.getByte(i_bytes));

Review Comment:
   I don't quite get the details here. Why do we need to pre-evalute 
`numBytesForFirstByte` now? It was evaluated at the end of the loop body before.



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