-
Notifications
You must be signed in to change notification settings - Fork 0
Use list #2
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
Conversation
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.
Pull Request Overview
This PR refactors the StringZipper data structure to use @list.List
instead of Array
for the left and right collections, improving performance and simplifying the implementation. The change addresses issue #1 by leveraging the more appropriate list data structure for prepend/append operations.
- Replaced Array fields with @list.List for left and right string view collections
- Updated all array operations to use corresponding list operations (pattern matching, add, each)
- Modified CI workflow to use nightly MoonBit version
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
string_zipper.mbt | Converts Array fields to @list.List and updates all related operations to use list-specific methods |
.github/workflows/ci.yml | Updates MoonBit installation to use nightly version |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
new_arr.push(elem) | ||
} | ||
new_arr | ||
list.add(view) |
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.
The add
method prepends to the beginning of the list, but based on the context and comment about 'reverse order', this should use cons
or prepend
for clarity. If add
appends to the end, the logic in to_string_and_pos
and to_string_debug
would be incorrect.
list.add(view) | |
list.prepend(view) |
Copilot uses AI. Check for mistakes.
Pull Request Test Coverage Report for Build 6Details
💛 - Coveralls |
Inefficient array conversion in string building operationsCategory Inconsistent absolute position calculation in drop_until_internalCategory Repeated pattern matching on list structureCategory |
closes #1