Skip to content

findAllReferences: Clean up uses of getWidth and getStart#15772

Merged
2 commits merged into
masterfrom
getWidth
May 11, 2017
Merged

findAllReferences: Clean up uses of getWidth and getStart#15772
2 commits merged into
masterfrom
getWidth

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented May 11, 2017

Fixes #14004

const possiblePositions = getPossibleSymbolReferencePositions(sourceFile, labelName, container);
for (const position of possiblePositions) {
const node = getTouchingWord(sourceFile, position);
if (!node || node.getWidth() !== labelName.length) {
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like an attempt at optimization, but getTargetLabel doesn't look that slow, and 99% of the time it's going to be to the same label.

@ghost ghost merged commit 7a64de3 into master May 11, 2017
@ghost ghost deleted the getWidth branch May 11, 2017 20:23
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants