Skip to content
Prev Previous commit
Next Next commit
response status name cleanup
  • Loading branch information
dkz2 committed May 26, 2023
commit 56242598c1ab0a1f09a2fe2a90ab2fcf726c950d
8 changes: 4 additions & 4 deletions Sources/SwiftMemcache/MemcachedResponseDecoder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ struct MemcachedResponseDecoder: ByteToMessageDecoder {
return .needMoreData
}

guard let asciiValue1 = buffer.readInteger(as: UInt8.self),
let asciiValue2 = buffer.readInteger(as: UInt8.self),
let responseCode = ResponseStatus(asciiValues: (asciiValue1, asciiValue2)) else {
guard let firstResponseDigit = buffer.readInteger(as: UInt8.self),
let secondResponseDigit = buffer.readInteger(as: UInt8.self),
let responseStatus = ResponseStatus(asciiValues: (firstResponseDigit, secondResponseDigit)) else {
preconditionFailure("Response code could not be read.")
}

Expand All @@ -45,7 +45,7 @@ struct MemcachedResponseDecoder: ByteToMessageDecoder {
preconditionFailure("Line ending '\r\n' not found after the flags.")
}

let setResponse = MemcachedResponse.SetResponse(status: responseCode)
let setResponse = MemcachedResponse.SetResponse(status: responseStatus)
context.fireChannelRead(self.wrapInboundOut(.set(setResponse)))
return .continue
}
Expand Down