Github user igreenfield commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22135#discussion_r211091975
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodeFormatter.scala
 ---
    @@ -91,10 +94,7 @@ object CodeFormatter {
       }
     
       def stripExtraNewLinesAndComments(input: String): String = {
    -    val commentReg =
    -      ("""([ |\t]*?\/\*[\s|\S]*?\*\/[ |\t]*?)|""" +    // strip /*comment*/
    -       """([ |\t]*?\/\/[\s\S]*?\n)""").r               // strip //comment
    -    val codeWithoutComment = commentReg.replaceAllIn(input, "")
    +    val codeWithoutComment = commentRegexp.replaceAllIn(input, "")
         codeWithoutComment.replaceAll("""\n\s*\n""", "\n") // strip 
ExtraNewLines
    --- End diff --
    
    this line also compile regex and could be replaced!


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to