diff --git a/Sources/NIOCore/ByteBuffer-hexdump.swift b/Sources/NIOCore/ByteBuffer-hexdump.swift index a52ad3ead4..de5ed26bf0 100644 --- a/Sources/NIOCore/ByteBuffer-hexdump.swift +++ b/Sources/NIOCore/ByteBuffer-hexdump.swift @@ -131,9 +131,9 @@ extension ByteBuffer { result += String(repeating: " ", count: 60 - result.count) // Right column renders the 16 bytes line as ASCII characters, or "." if the character is not printable. + let printableRange = UInt8(ascii: " ") ..< UInt8(ascii: "~") let printableBytes = self.readableBytesView.map { - let printableRange = UInt8(ascii: " ") ..< UInt8(ascii: "~") - return printableRange.contains($0) ? $0 : UInt8(ascii: ".") + printableRange.contains($0) ? $0 : UInt8(ascii: ".") } result += "|"