changeset 2083:9f65e2188d3c

MonoOpt: remove concatenation with empty string
author Adam Chlipala <adam@chlipala.net>
date Wed, 03 Dec 2014 21:21:37 -0500
parents 1b76ae703cbb
children 0d48cfb59b29
files src/mono_opt.sml
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/mono_opt.sml	Wed Dec 03 21:06:15 2014 -0500
+++ b/src/mono_opt.sml	Wed Dec 03 21:21:37 2014 -0500
@@ -166,6 +166,9 @@
             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