Skip to content

Commit

Permalink
avoid threadvar (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
arnetheduck authored Oct 1, 2024
1 parent d5274f8 commit 2717b21
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions confutils/winreg/reader.nim
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,18 @@ proc readValue*[T](r: var WinregReader, value: var T)
elif T is (object or tuple):
type T = type(value)
when T.totalSerializedFields > 0:
let fields = T.fieldReadersTable(WinregReader)
const fields = T.fieldReadersTable(WinregReader)
var expectedFieldPos = 0
r.key.add ""
value.enumInstanceSerializedFields(fieldName, field):
when T is tuple:
r.key[^1] = $expectedFieldPos
var reader = fields[][expectedFieldPos].reader
var reader = fields[expectedFieldPos].reader
expectedFieldPos += 1

else:
r.key[^1] = fieldName
var reader = findFieldReader(fields[], fieldName, expectedFieldPos)
var reader = findFieldReader(fields, fieldName, expectedFieldPos)

if reader != nil:
reader(value, r)
Expand Down

0 comments on commit 2717b21

Please sign in to comment.