Merge pull request #3933 from dwijnand/ServerSpec-Codacy2

Fix another Codacy issue in ServerSpec
This commit is contained in:
Dale Wijnand 2018-02-09 12:38:27 +00:00 committed by GitHub
commit 638dbeb84c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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.
}