Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Iter.ml to use mutable fields instead of refs #44

Merged
merged 2 commits into from
Jan 9, 2024

Conversation

jan-pi-sona-lili
Copy link
Contributor

In MList, type 'a node = Nil | Cons of 'a array * int ref * 'a node ref was changed to type 'a node = Nil | Cons of { a : 'a array; mutable n : int; mutable tl : 'a node } and all functions in MList were updated accordingly. This should hopefully make MList be a little faster (less indirection needed) and use less memory.

`type 'a node = Nil | Cons of 'a array * int ref * 'a node ref` was changed to `type 'a node = Nil | Cons of { a : 'a array; mutable n : int; mutable tl : 'a node }` and all functions in MList were updated accordingly
Copy link
Owner

@c-cube c-cube left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks really nice. I only have a couple of minor quibbles :)

src/Iter.ml Show resolved Hide resolved
src/Iter.ml Outdated Show resolved Hide resolved
@c-cube c-cube merged commit 92d0022 into c-cube:master Jan 9, 2024
4 checks passed
@jan-pi-sona-lili jan-pi-sona-lili deleted the patch-2 branch January 9, 2024 23:03
@c-cube
Copy link
Owner

c-cube commented Jan 10, 2024

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants