nob13 commented on code in PR #1380:
URL:
https://github.com/apache/cassandra-spark-connector/pull/1380#discussion_r2469473559
##########
driver/src/main/scala/com/datastax/spark/connector/types/TypeConverter.scala:
##########
@@ -270,7 +270,18 @@ object TypeConverter {
}
}
- private def byteArrayToString (x: Array[Byte]) = "0x" + x.map("%02x" format
_).mkString
+ private val HEX_CHARS = Array(
+ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e',
'f'
+ )
+ private def byteArrayToString (x: Array[Byte]) : String = {
+ val result = new StringBuilder(x.length * 2)
Review Comment:
Nit: Why not using `x.length * 2 + 2` and already inserting `0x` ? Then you
can return result.toString()
--
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]