minor improvement to string optimisation (#1514)
authorAlex Lam S.L <alexlamsl@gmail.com>
Thu, 2 Mar 2017 03:31:39 +0000 (11:31 +0800)
committerGitHub <noreply@github.com>
Thu, 2 Mar 2017 03:31:39 +0000 (11:31 +0800)
commitfdc9b9413bfddc711fe6195bd4fd408ab1dfa95e
tree867fc780891c6e248a3510d9e34ac77b9914949d
parent40ceddb48a6ea8d6864667574fa9db37ccc9a6bf
minor improvement to string optimisation (#1514)

- "" + "a"     => "a"
- "" + a + "b" => a + "b"
- "a" + ""     => "a" (improving on #45)
lib/compress.js
test/compress/concat-strings.js