mirror of https://github.com/sbt/sbt.git
Fix Codacy issue in ServerSpec
This commit is contained in:
parent
b228af3cf1
commit
a9bdcc4f0f
|
|
@ -108,9 +108,8 @@ object ServerSpec {
|
||||||
val chunk0 = buffer.take(delimPos)
|
val chunk0 = buffer.take(delimPos)
|
||||||
buffer = buffer.drop(delimPos + 1)
|
buffer = buffer.drop(delimPos + 1)
|
||||||
// remove \r at the end of line.
|
// remove \r at the end of line.
|
||||||
if (chunk0.size > 0 && chunk0.indexOf(RetByte) == chunk0.size - 1)
|
val chunk1 = if (chunk0.isEmpty || chunk0.last != RetByte) chunk0 else chunk0.dropRight(1)
|
||||||
Some(new String(chunk0.dropRight(1).toArray, "utf-8"))
|
Some(new String(chunk1.toArray, "utf-8"))
|
||||||
else Some(new String(chunk0.toArray, "utf-8"))
|
|
||||||
} else None // no EOL yet, so skip this turn.
|
} else None // no EOL yet, so skip this turn.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue