disable TR macro for increased compile times; define nimTrMacros to re-enable

This commit is contained in:
Andreas Rumpf
2016-08-08 20:21:05 +02:00
parent 1f34117c06
commit 94a9688556

View File

@@ -1744,7 +1744,7 @@ proc swap*[T](a, b: var T) {.magic: "Swap", noSideEffect.}
## swaps the values `a` and `b`. This is often more efficient than
## ``tmp = a; a = b; b = tmp``. Particularly useful for sorting algorithms.
when not defined(js) and not defined(booting):
when not defined(js) and not defined(booting) and defined(nimTrMacros):
template swapRefsInArray*{swap(arr[a], arr[b])}(arr: openarray[ref], a, b: int) =
# Optimize swapping of array elements if they are refs. Default swap
# implementation will cause unsureAsgnRef to be emitted which causes