Fix for https://github.com/dart-lang/tools/issues/2481 - #2482
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request updates the block list appending logic in yaml_edit to trim trailing whitespace when finding the next newline index. The reviewer identified a performance issue where creating a substring on every append operation leads to O(N) time and memory complexity, as well as a potential RangeError crash if the index becomes negative. An optimized O(1) auxiliary space solution was suggested to scan backwards instead.
Contribution guidelines:
dart format.Many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.
Note: The Dart team is trialing Gemini Code Assist. Don't take its comments as final Dart team feedback. Use the suggestions if they're helpful; otherwise, wait for a human reviewer.