use StandardCharsets (#934)

This commit is contained in:
PJ Fanning 2024-01-13 12:40:16 +01:00 committed by GitHub
parent 2ae6c8d00c
commit 6883d15576
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 12 deletions

View file

@ -15,7 +15,7 @@ package org.apache.pekko.remote.artery
import java.nio.ByteBuffer
import java.nio.ByteOrder
import java.nio.charset.Charset
import java.nio.charset.StandardCharsets
import java.util.concurrent.TimeUnit
import org.openjdk.jmh.annotations._
@ -30,7 +30,7 @@ import org.apache.pekko.util.Unsafe
@Measurement(iterations = 10)
class LiteralEncodingBenchmark {
private val UsAscii = Charset.forName("US-ASCII")
private val UsAscii = StandardCharsets.US_ASCII
private val str = "pekko://SomeSystem@host12:1234/user/foo"
private val buffer = ByteBuffer.allocate(128).order(ByteOrder.LITTLE_ENDIAN)
private val literalChars = Array.ofDim[Char](64)