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
commit7639360d7a0111054b68c3fe91bb2558706aaefc (patch)
tree5e685f48f7f8dc6a7f39dad70d9171aed82a204e /src
parentc881c3b462801bc67419783c4169302fce5e3aeb (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