-
Notifications
You must be signed in to change notification settings - Fork 103
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
refactor: @immut/array.make and @immut/array.makei #1765
base: main
Are you sure you want to change the base?
refactor: @immut/array.make and @immut/array.makei #1765
Conversation
a1e7fcb
to
0ed43d5
Compare
Pull Request Test Coverage Report for Build 5695Details
💛 - Coveralls |
Array::make(quot, FixedArray::make(branching_factor, value)) | ||
} else { | ||
let arr : Array[FixedArray[A]] = Array::make(quot + 1, []) | ||
for k in 0..<quot { | ||
arr[k] = FixedArray::make(branching_factor, value) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the alias here expected (using Array::make
)? If yes, should it apply to the second arr
too?
let arr : Array[FixedArray[A]] = Array::make(quot + 1, FixedArray::make(branching_factor, value))
arr[quot] = FixedArray::make(rem, value)
avoid use closure
0ed43d5
to
44a720a
Compare
The pull request aims to simplify the implementation of 💡 [Improvement in code clarity and simplicity]
|
avoid use closure
And this implementation will be a bit simpler than the previous new_by_leaves, and can also be reused by from_iter