浏览代码

* do str(...) optimization only in level 3+ mode

florian 1 年之前
父节点
当前提交
3539b4a6f3
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      compiler/ncal.pas

+ 4 - 0
compiler/ncal.pas

@@ -2737,6 +2737,10 @@ implementation
         case intrinsiccode of
           in_str_x_string:
             begin
+              { rare optimization opportunity which takes some extra time,
+                so check only at level 3+ }
+              if not(cs_opt_level3 in current_settings.optimizerswitches) then
+                exit;
               { If n is a constant, attempt to convert, for example:
                   "Str(5, Output);" to "Output := '5';" }