summary refs log tree commit diff stats
path: root/compiler/ccgexprs.nim
diff options
context:
space:
mode:
authorArne Döring <arne.doering@gmx.net>2019-03-28 12:32:02 +0100
committerAndreas Rumpf <rumpf_a@web.de>2019-03-28 12:32:02 +0100
commite904b3f952011ad9531b0923c2000398373af687 (patch)
treeecc07a898ae2e264b9d7600e2518548328a4803d /compiler/ccgexprs.nim
parentfcd3b0c4d8f266ca60aa0b2afe1f00bb68b4a9a4 (diff)
downloadNim-e904b3f952011ad9531b0923c2000398373af687.tar.gz
code cleanup (#10874)
Diffstat (limited to 'compiler/ccgexprs.nim')
-rw-r--r--compiler/ccgexprs.nim13
1 files changed, 2 insertions, 11 deletions
diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim
index 4026a429e..7376dd374 100644
--- a/compiler/ccgexprs.nim
+++ b/compiler/ccgexprs.nim
@@ -95,17 +95,8 @@ proc genLiteral(p: BProc, n: PNode): Rope =
 
 proc bitSetToWord(s: TBitSet, size: int): BiggestInt =
   result = 0
-  when true:
-    for j in countup(0, size - 1):
-      if j < len(s): result = result or `shl`(ze64(s[j]), j * 8)
-  else:
-    # not needed, too complex thinking:
-    if CPU[platform.hostCPU].endian == CPU[targetCPU].endian:
-      for j in countup(0, size - 1):
-        if j < len(s): result = result or `shl`(Ze64(s[j]), j * 8)
-    else:
-      for j in countup(0, size - 1):
-        if j < len(s): result = result or `shl`(Ze64(s[j]), (Size - 1 - j) * 8)
+  for j in 0 ..< size:
+    if j < len(s): result = result or (ze64(s[j]) shl (j * 8))
 
 proc genRawSetData(cs: TBitSet, size: int): Rope =
   var frmt: FormatStr