From 8c1dd215ac4f47657db5c26f04c9d2b37aa9980d Mon Sep 17 00:00:00 2001 From: Hans Raaf Date: Sun, 6 Mar 2016 00:59:27 +0100 Subject: Fix for PHP mnewString() --- lib/system/jssys.nim | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'lib/system') 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 """ -- cgit 1.4.1-2-gfad0