You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some contracts tend to accumulate lots of nested empty maps and when the semantics of the contract permits we should have a mechanism to clean the empty maps. @vaivaswatha has suggested to implement this as a new builtin because it's easier to do this at the C++ level.
Example:
A map like this
{
"key1" -> {"key1a" -> 42}
"key2" -> {}
"key3" -> {}
...
"key42" -> {}
}
often times can be simplified to
{
"key1" -> {"key1a" -> 42}
}
The text was updated successfully, but these errors were encountered:
A common scenario is when in a nested map, all keys of a nested map are deleted (and we have an empty map), but the corresponding key in the outer map (that now holds an empty inner map as its value) lives on.
A builtin can be provided to prune such keys in an outer map that have empty map values.
Implementation: It looks to me that the best way to do this is to have a direct call, via IPC, to the blockchain code that will scan the leveldb database and perform this operation.
Edit: This comment turned out to be redundant given @anton-trunov 's update to the Issue description. I'll let it stay on though.
Some contracts tend to accumulate lots of nested empty maps and when the semantics of the contract permits we should have a mechanism to clean the empty maps. @vaivaswatha has suggested to implement this as a new builtin because it's easier to do this at the C++ level.
Example:
often times can be simplified to
The text was updated successfully, but these errors were encountered: