Skip to content

Commit

Permalink
Merge pull request #1888 from chriswebster/fe
Browse files Browse the repository at this point in the history
Switch for comprehension + `to` range method to foreach call.

This was imposing somewhere between a 12-18% performance penalty.
  • Loading branch information
Shadowfiend committed Aug 5, 2017
2 parents f7ace67 + 0c3e066 commit db05d86
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions core/json/src/main/scala/net/liftweb/json/JsonAST.scala
Original file line number Diff line number Diff line change
Expand Up @@ -817,8 +817,7 @@ object JsonAST {
}

private def appendEscapedString(buf: Appendable, s: String, settings: RenderSettings) {
for (i <- 0 until s.length) {
val c = s.charAt(i)
s.foreach { c =>
val strReplacement = c match {
case '"' => "\\\""
case '\\' => "\\\\"
Expand Down

0 comments on commit db05d86

Please sign in to comment.