As the lookups internally perform an expensive keccak256 operation, we advise the lookups to be cached wherever possible to a single local declaration that either holds the value of the mapping in case of primitive types or holds a storage pointer to the struct contained.
Team will prefer to keep this code unchanged. prepareCurvePools receives both parameters as memory marked and due to that it would not work when converting to strorage
WSY-03C: Inefficient
mapping
LookupsDescription:
The linked statements perform key-based lookup operations on
mapping
declarations from storage multiple times for the same key redundantly.Example:
Recommendation:
As the lookups internally perform an expensive
keccak256
operation, we advise the lookups to be cached wherever possible to a single local declaration that either holds the value of themapping
in case of primitive types or holds astorage
pointer to thestruct
contained.