Skip to content

Commit

Permalink
Simplify printable bytes closure to a single expression so Swift 5.6 …
Browse files Browse the repository at this point in the history
…is happy
  • Loading branch information
natikgadzhi committed Aug 15, 2023
1 parent 47bebae commit dc65676
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/NIOCore/ByteBuffer-hexdump.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 += "|"
Expand Down

0 comments on commit dc65676

Please # to comment.