Small scope refactoring (#18263)

* Small scope refactoring

* Add test for #10251

* Add inline where appropriate
This commit is contained in:
Clyybber 2021-06-14 19:19:58 +02:00 • committed by GitHub
commit 8c42f5be02
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 33 additions and 24 deletions

View file

@ -777,9 +777,10 @@ proc strTableInclReportConflict*(t: var TStrTable, n: PSym;
replaceSlot = h
h = nextTry(h, high(t.data))
if replaceSlot >= 0:
result = t.data[replaceSlot] # found it
if not onConflictKeepOld:
t.data[replaceSlot] = n # overwrite it with newer definition!
return t.data[replaceSlot] # found it
return result
elif mustRehash(t.data.len, t.counter):
strTableEnlarge(t)
strTableRawInsert(t.data, n)