summary refs log tree commit diff stats
path: root/lib/system/jssys.nim
diff options
context:
space:
mode:
Diffstat (limited to 'lib/system/jssys.nim')
-rw-r--r--lib/system/jssys.nim4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/system/jssys.nim b/lib/system/jssys.nim
index c96f2f958..1b98883b9 100644
--- a/lib/system/jssys.nim
+++ b/lib/system/jssys.nim
@@ -263,9 +263,7 @@ proc toJSStr(s: string): cstring {.asmNoStackFrame, compilerproc.} =
 proc mnewString(len: int): string {.asmNoStackFrame, compilerproc.} =
   when defined(nimphp):
     asm """
-      $result = array();
-      for($i = 0; $i < `len`; $i++) $result[] = chr(0);
-      return $result;
+      return str_repeat(chr(0),`len`);
     """
   else:
     asm """