minor code cleanup
This commit is contained in:
parent
f8266c7376
commit
e641bc7df0
1 changed files with 1 additions and 7 deletions
|
|
@ -576,12 +576,6 @@ proc strTableAdd(t: var TStrTable, n: PSym) =
|
||||||
strTableRawInsert(t.data, n)
|
strTableRawInsert(t.data, n)
|
||||||
inc(t.counter)
|
inc(t.counter)
|
||||||
|
|
||||||
proc reallySameIdent(a, b: string): bool {.inline.} =
|
|
||||||
when defined(nimfix):
|
|
||||||
result = a[0] == b[0]
|
|
||||||
else:
|
|
||||||
result = true
|
|
||||||
|
|
||||||
proc strTableIncl*(t: var TStrTable, n: PSym; onConflictKeepOld=false): bool {.discardable.} =
|
proc strTableIncl*(t: var TStrTable, n: PSym; onConflictKeepOld=false): bool {.discardable.} =
|
||||||
# returns true if n is already in the string table:
|
# returns true if n is already in the string table:
|
||||||
# It is essential that `n` is written nevertheless!
|
# It is essential that `n` is written nevertheless!
|
||||||
|
|
@ -596,7 +590,7 @@ proc strTableIncl*(t: var TStrTable, n: PSym; onConflictKeepOld=false): bool {.d
|
||||||
# and overloading: (var x=@[]; x).mapIt(it).
|
# and overloading: (var x=@[]; x).mapIt(it).
|
||||||
# So it is possible the very same sym is added multiple
|
# So it is possible the very same sym is added multiple
|
||||||
# times to the symbol table which we allow here with the 'it == n' check.
|
# times to the symbol table which we allow here with the 'it == n' check.
|
||||||
if it.name.id == n.name.id and reallySameIdent(it.name.s, n.name.s):
|
if it.name.id == n.name.id:
|
||||||
if it == n: return false
|
if it == n: return false
|
||||||
replaceSlot = h
|
replaceSlot = h
|
||||||
h = nextTry(h, high(t.data))
|
h = nextTry(h, high(t.data))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue