Avoid hint label collision #1289
Open
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.
If a hint pattern results in the number of hint labels exceeding the size of the alphabet, then some of the labels will need to be two characters instead of just one character. Sometimes this results in a mixture of single-character and two-character hint labels. However, as currently implemented, there is a chance for some of the two-character hint labels starting with the same character as a single-character label. For example, the set of hint labels might contain "j" and "ja" and "jb" and "jc" but in this case, it would be impossible to select the object associated with hint label "j" since the hint engine will still be attempting to match against "ja" or "jb" etc.
This commit resolves this issue by removing the shorter label ("j" in the example above) before adding the longer labels ("ja" and "jb" etc.).