[bugfix] critbits styleCheck fix: consistent var naming (#11752)

This commit is contained in:
Kaushal Modi
2019-07-16 15:24:09 -04:00
committed by Miran
parent 3f7142fcfd
commit 44d80dd863

View File

@@ -17,7 +17,7 @@ include "system/inclrtl"
type
NodeObj[T] {.acyclic.} = object
byte: int ## byte index of the difference
otherbits: char
otherBits: char
case isLeaf: bool
of false: child: array[0..1, ref NodeObj[T]]
of true:
@@ -69,14 +69,14 @@ proc rawInsert[T](c: var CritBitTree[T], key: string): Node[T] =
var newOtherBits = 0
var newByte = 0
block blockX:
while newbyte < key.len:
let ch = if newbyte < it.key.len: it.key[newbyte] else: '\0'
if ch != key[newbyte]:
newotherbits = ch.ord xor key[newbyte].ord
while newByte < key.len:
let ch = if newByte < it.key.len: it.key[newByte] else: '\0'
if ch != key[newByte]:
newOtherBits = ch.ord xor key[newByte].ord
break blockX
inc newbyte
if newbyte < it.key.len:
newotherbits = it.key[newbyte].ord
inc newByte
if newByte < it.key.len:
newOtherBits = it.key[newByte].ord
else:
return it
while (newOtherBits and (newOtherBits-1)) != 0: