[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
commit 44d80dd863

View file

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