Repository navigation
fix(engine): O(n²) drops slice/concat array evidence shadowed by a string - #195
Merged
Merged
Conversation
…ring
String#slice and String#concat share names with the array methods. In
webpack's syntax-parser one `const text = store.input.slice(...)` made
every `text` in the 18k-line file an array, so text.indexOf("*/", i)
string searches were counted as quadratic scans.
Evidence from only slice/concat is now dropped when the same file also
declares that name without array evidence. Same clones, old vs new
engine: 2,182 -> 2,175 candidates, all seven removed sites are string
indexOf (webpack 4, vscode 2, nocodb bundled vue 1); no score changes,
so the scoring version stays v17.
Claude-Session: https://claude.ai/code/session_01W9Mk18mBNfkPfgg3hYweKq
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
webpack's
const text = store.input.slice(...)made everytextin the file an array, so stringtext.indexOf(...)calls counted as O(n²). Evidence from slice/concat alone is now dropped when the name is also declared without array evidence. Same-clone old vs new: 2,182 → 2,175 candidates, all 7 removed are string indexOf; no score changes (v17 kept). Fixture + FP catalog row; breaking the guard fails the fixture.https://claude.ai/code/session_01W9Mk18mBNfkPfgg3hYweKq