8000 fix(`@list.T::rev_fold`): deprecated message by illusory0x0 · Pull Request #2287 · moonbitlang/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix(@list.T::rev_fold): deprecated message #2287

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

Merged
merged 3 commits into from
Jun 20, 2025

Conversation

illusory0x0
Copy link
Contributor

_.to_array().rev_fold(...) is faster than _.rev().fold(...) in RC backend

`_.to_array().r
8000
ev_fold(...)` is faster than `_.rev().fold(...)` in RC
backend
Copy link
peter-jerry-ye-code-review bot commented Jun 17, 2025
Documentation update reflects better performing alternative

Category
Performance
Code Snippet
#deprecated("use _.to_array().rev_fold(...) instead")
Recommendation
The change itself is good, but consider adding a brief comment explaining the performance benefit
Reasoning
While the change correctly guides users to a more performant approach, adding a brief explanation of why this is faster would help developers make informed decisions

Deprecated function could use performance context

Category
Maintainability
Code Snippet
pub fn[A, B] T::rev_fold(self : T[A], init~ : B, f : (B, A) -> B) -> B {
Recommendation
Add a comment explaining the performance characteristics of different approaches
Reasoning
This would help maintainers understand the rationale for deprecation and guide users in choosing the most appropriate alternative for their use case

@coveralls
Copy link
Collaborator
coveralls commented Jun 17, 2025

Pull Request Test Coverage Report for Build 7387

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 89.888%

Totals Coverage Status
Change from base Build 7385: 0.0%
Covered Lines: 8507
Relevant Lines: 9464

💛 - Coveralls

@peter-jerry-ye peter-jerry-ye requested a review from bobzhang June 17, 2025 06:03
@bobzhang bobzhang enabled auto-merge (rebase) June 19, 2025 10:04
auto-merge was automatically disabled June 19, 2025 10:10

Rebase failed

@bobzhang bobzhang enabled auto-merge (rebase) June 20, 2025 01:04
auto-merge was automatically disabled June 20, 2025 01:14

Rebase failed

@bobzhang bobzhang merged commit f8525a9 into moonbitlang:main Jun 20, 2025
16 checks passed
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.

3 participants
0