tk3369 / BinaryTraits.jl

Can do or not? It's easy. See https://tk3369.github.io/BinaryTraits.jl/dev/
MIT License
51 stars 3 forks source link

BUG: Antipattern used in implementation #32

Closed KlausC closed 4 years ago

KlausC commented 4 years ago

At several spots in the source code I found this pattern:

x = get!(dict, key, Constructor())

That will create an instance of Constructor every time the line is executed (while needed only once for each key). It should be replaced by

x = get!(dict, key) do; Constructor() end
tk3369 commented 4 years ago

Great report!