use more of StandardCharsets (#952)

* use more of StandardCharsets

* scalafmt
This commit is contained in:
PJ Fanning 2024-01-14 23:50:50 +01:00 committed by GitHub
parent 485639ef82
commit 8c688dad2e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 68 additions and 46 deletions

View file

@ -13,7 +13,7 @@
package org.apache.pekko.util
import java.nio.charset.Charset
import java.nio.charset.StandardCharsets
import java.util.concurrent.TimeUnit
import org.openjdk.jmh.annotations._
@ -31,8 +31,8 @@ class ByteString_decode_Benchmark {
val bss_large = ByteStrings(Vector.fill(4)(bs_large.asInstanceOf[ByteString1C].toByteString1), 4 * bs_large.length)
val bc_large = bss_large.compact // compacted
val utf8String = "utf-8"
val utf8 = Charset.forName(utf8String)
val utf8 = StandardCharsets.UTF_8
val utf8String = utf8.name
/*
Using Charset helps a bit, but nothing impressive: