-
Notifications
You must be signed in to change notification settings - Fork 28.1k
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
Check sequences is strongly equal. #219937
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for your PR and the effort you put into it!
I'm not sure though I understand where the bug comes from and how this PR fixes the bug.
Why is isStronglyEqual
not doing it?
if (sequence1.getElement(seq1OffsetS) === sequence1.getElement(seq1OffsetE) && | ||
!sequence1.isEmpty(seq1OffsetS) && !sequence1.isEmpty(seq1OffsetE) && | ||
!sequence1.isStronglyEqual(seq1OffsetS, seq1OffsetE) && | ||
((sequence1 as any).lines[seq1OffsetS] === (sequence2 as any).lines[seq2OffsetS]) && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The as any
is not good here.
* seq1: [ pass] [ pass] | ||
* seq2: [ pass] [ pass] | ||
*/ | ||
function checkSequencesIsStronglyEqual(sequence1: ISequence, seq1OffsetS: number, seq1OffsetE: number, sequence2: ISequence, seq2OffsetS: number, seq2OffsetE: number): boolean { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I undestand what this function is supposed to do.
fix #214962
Current:
![current](https://private-user-images.githubusercontent.com/48614781/345782911-5cf1ade2-cacb-4c7a-8735-000ba39b4d0c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA1NzIyMDIsIm5iZiI6MTcyMDU3MTkwMiwicGF0aCI6Ii80ODYxNDc4MS8zNDU3ODI5MTEtNWNmMWFkZTItY2FjYi00Yz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