Fix another Codacy issue in ServerSpec

This commit is contained in:
Dale Wijnand 2018-02-08 14:16:14 +00:00
parent d75d95d653
commit 74ff6aa1ce
No known key found for this signature in database
GPG Key ID: 4F256E3D151DF5EF
1 changed files with 1 additions and 1 deletions

View File

@ -108,7 +108,7 @@ object ServerSpec {
val chunk0 = buffer.take(delimPos)
buffer = buffer.drop(delimPos + 1)
// remove \r at the end of line.
val chunk1 = if (chunk0.isEmpty || chunk0.last != RetByte) chunk0 else chunk0.dropRight(1)
val chunk1 = if (chunk0.lastOption contains RetByte) chunk0.dropRight(1) else chunk0
Some(new String(chunk1.toArray, "utf-8"))
} else None // no EOL yet, so skip this turn.
}