Skip to content
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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

tisilent
Copy link
Contributor

@tisilent tisilent commented Jul 4, 2024

fix #214962

Current:
current

Fixed:
fixed

Copy link
Member

@hediet hediet left a 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]) &&
Copy link
Member

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 {
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Diff chunks are not optimal
2 participants