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 current implementation of hasherlife uses IDs as handles to the actual Nodes in the HashMap<ID, Node>. Instead it would be sufficient to use references (&Node) into a HashSet<Node>.
The largest problem with this refactoring lies in satisfying the borrowck because there are a lot of lifetimes involved. I'm not sure if it is even feasible to do a trivial refactoring or if it's necessary to use different data structures altogether. Maybe there is unsafe code necessary.
Another problem is the immutability of the hashset entries. We need a different way to memoize the computed Inode::result because we can't mutate the Nodes.
The text was updated successfully, but these errors were encountered:
The current implementation of hasherlife uses
ID
s as handles to the actualNode
s in theHashMap<ID, Node>
. Instead it would be sufficient to use references (&Node
) into aHashSet<Node>
.The largest problem with this refactoring lies in satisfying the borrowck because there are a lot of lifetimes involved. I'm not sure if it is even feasible to do a trivial refactoring or if it's necessary to use different data structures altogether. Maybe there is unsafe code necessary.
Another problem is the immutability of the hashset entries. We need a different way to memoize the computed
Inode::result
because we can't mutate theNode
s.The text was updated successfully, but these errors were encountered: