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
The HAMT and AMT flush methods write the root block content to store even if it's the same data that was read from store. While this could in theory be detected and prevented by callers, it's easily overlooked. For example, a common pattern is:
load HAMT root
iterate over N things to update it
flush HAMT root
... where N can be zero.
To implement, I suggest Node::flush() return a boolean indicating whether it wrote anything, and then skip writing the root node if it didn't.
The text was updated successfully, but these errors were encountered:
The HAMT and AMT flush methods write the root block content to store even if it's the same data that was read from store. While this could in theory be detected and prevented by callers, it's easily overlooked. For example, a common pattern is:
... where N can be zero.
To implement, I suggest
Node::flush()
return a boolean indicating whether it wrote anything, and then skip writing the root node if it didn't.The text was updated successfully, but these errors were encountered: