He-Pin opened a new pull request, #3145:
URL: https://github.com/apache/pekko/pull/3145
### Motivation
Manual per-byte hex encoding with `"%02x".format()` is verbose and allocates
a `String` per byte. JDK 17's `HexFormat` formats entire byte arrays in one
call with zero intermediate allocations.
### Modification
- `VectorClock.scala`: Replace `digester.digest.map("%02x".format).mkString`
with `HexFormat.of().formatHex(digester.digest())`
- `TcpFraming.scala`: Replace `.map("%02x".format).mkString(" ")` with
`HexFormat.ofDelimiter(" ").formatHex(bytes.toArray)`
### Result
More concise code, fewer allocations (one `String` vs N+1 `String`s),
standard JDK 17 API for hex encoding.
### Tests
- `sbt "cluster/compile" "remote/compile"` — passed
### References
Refs #3136
--
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]