Permalink
Browse files

Stores safe operator nim version.

  • Loading branch information...
1 parent cd5ea46 commit 7ef75336bc33a953c118db40d30a939e64d26cbb @gradha committed Feb 27, 2016
Showing with 3 additions and 3 deletions.
  1. +3 −3 swift/performance_problems/time_nanos.nim
@@ -14,13 +14,13 @@ proc s*(x: int64): Nano {.inline.} = x * u_second
proc i*(x: int64): Nano {.inline.} = x * u_minute
proc `$`*(x: Nano): string = $(int64(x))
-proc `+`*(x: Nano, y: string): string = $x & y
-proc `+`*(x: string, y: Nano): string = x & $y
+proc `&`*(x: Nano, y: string): string = $x & y
+proc `&`*(x: string, y: Nano): string = x & $y
proc test_seconds*() =
echo "Testing second operations:\n"
echo u_minute + u_second + Nano(500), " = ", 1.i + 1.s + 500.ns
- echo u_minute + u_second + Nano(500) + " = " + 1.i + 1.s + 500.ns
+ echo u_minute + u_second + Nano(500) & " = " & 1.i + 1.s + 500.ns
test_seconds()

0 comments on commit 7ef7533

Please sign in to comment.