feat(store,world): add ability to unregister hooks#1422
Conversation
🦋 Changeset detectedLatest commit: 3474859 The changes in this PR will be included in the next version bump. This PR includes changesets to release 28 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
1203619 to
dbd0dc9
Compare
| // (Note: this does not update the free memory pointer) | ||
| assembly { | ||
| mstore(newHooks, newHooksIndex) | ||
| } |
There was a problem hiding this comment.
Since the "remove a hook from the list of hooks" is duplicated, should we move this into some sort of hooks lib?
frolic
left a comment
There was a problem hiding this comment.
Just one comment about code duplication but not blocking!
| * Filter the given hook from the hook list at the given key in the given hook table | ||
| */ | ||
| function filterListByAddress(bytes32 hookTableId, bytes32 key, address hookAddressToRemove) internal { | ||
| bytes21[] memory currentHooks = Hooks.get(hookTableId, key); |
There was a problem hiding this comment.
Is it better/more gas efficient to do the get/set here than to pass in the array and get an array back out (a more functional approach)?
There was a problem hiding this comment.
yeah, unfortunately much more gas efficient to pass as little memory around as possible - passing arrays is pretty expensive. (Otherwise would have preferred a more functional approach with arrays as input/output too)
Fixes #1405
Followup to #1399
Context in the changeset