summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2014-12-03 21:21:37 -0500
committerGravatar Adam Chlipala <adam@chlipala.net>2014-12-03 21:21:37 -0500
commiteb9945d40c8f06409d2840e2e23838d91b00f974 (patch)
tree5e685f48f7f8dc6a7f39dad70d9171aed82a204e /src
parent6562c109940116262cc6875c4475383f8b8fb891 (diff)
MonoOpt: remove concatenation with empty string
Diffstat (limited to 'src')
-rw-r--r--src/mono_opt.sml3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mono_opt.sml b/src/mono_opt.sml
index a49d54e1..211b273e 100644
--- a/src/mono_opt.sml
+++ b/src/mono_opt.sml
@@ -166,6 +166,9 @@ fun exp e =
e
| EFfiApp ("Basis", "strcat", [(e1, _), (e2, _)]) => exp (EStrcat (e1, e2))
+
+ | EStrcat (e1, (EPrim (Prim.String (_, "")), _)) => #1 e1
+ | EStrcat ((EPrim (Prim.String (_, "")), _), e2) => #1 e2
| EStrcat ((EPrim (Prim.String (Prim.Html, s1)), loc), (EPrim (Prim.String (Prim.Html, s2)), _)) =>
let