xkrogen commented on a change in pull request #33287:
URL: https://github.com/apache/spark/pull/33287#discussion_r668048393
##########
File path:
common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java
##########
@@ -573,15 +573,16 @@ public UTF8String trim() {
*/
public UTF8String trimAll() {
int s = 0;
+ byte currentByte;
// skip all of the whitespaces (<=0x20) in the left side
- while (s < this.numBytes && Character.isWhitespace(getByte(s))) s++;
+ while (s < this.numBytes && 0 <= (currentByte = getByte(s)) && currentByte
<= 0x20) s++;
Review comment:
Seems like this would be a good time to pull this logic out into a
shared method? The if-condition is getting a bit more complicated and hard to
read with the temporary variable.
--
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]