Browse Source

* append optimization also for constant strings

git-svn-id: trunk@1950 -
peter 19 years ago
parent
commit
24d972c012
1 changed files with 3 additions and 2 deletions
  1. 3 2
      compiler/nld.pas

+ 3 - 2
compiler/nld.pas

@@ -521,9 +521,10 @@ implementation
                 { opportunity quite difficult to detect (JM)               }
                 { opportunity quite difficult to detect (JM)               }
                 resulttypepass(tbinarynode(right).left);
                 resulttypepass(tbinarynode(right).left);
                 resulttypepass(tbinarynode(right).right);
                 resulttypepass(tbinarynode(right).right);
-                if (is_char(tbinarynode(right).right.resulttype.def) or
+                if (tbinarynode(right).right.nodetype=stringconstn) or
+		   is_char(tbinarynode(right).right.resulttype.def) or
                    is_shortstring(tbinarynode(right).right.resulttype.def) or
                    is_shortstring(tbinarynode(right).right.resulttype.def) or
-                   is_ansistring(tbinarynode(right).right.resulttype.def)) then
+                   is_ansistring(tbinarynode(right).right.resulttype.def) then
                   begin
                   begin
                     { remove property flag so it'll not trigger an error }
                     { remove property flag so it'll not trigger an error }
                     exclude(left.flags,nf_isproperty);
                     exclude(left.flags,nf_isproperty);