Skip to content

Commit

Permalink
Cleanup TextDiffBuilder>>#findMatches
Browse files Browse the repository at this point in the history
Fix #9462
  • Loading branch information
astares committed Jun 16, 2021
1 parent 208e095 commit 2d3c9d9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/Text-Diff/TextDiffBuilder.class.st
Expand Up @@ -168,12 +168,10 @@ TextDiffBuilder >> findMatches [
"Filter out all lines that can't have a pair."
temp := yLines asSet.
xFilteredLines := xLines select: [ :each | temp includes: each ].
xFilteredLines size = 0
ifTrue: [ ^ self ].
xFilteredLines ifEmpty: [ ^ self ].
temp := xLines asSet.
yFilteredLines := yLines select: [ :each | temp includes: each ].
yFilteredLines size = 0
ifTrue: [ ^ self ]. "Map all lines to SmallIntegers, because they can be compared faster."
yFilteredLines ifEmpty: [ ^ self ]. "Map all lines to SmallIntegers, because they can be compared faster."
temp := Dictionary new.
xNumbers := xFilteredLines collect: [ :each | temp at: each ifAbsentPut: [ temp size ] ].
yNumbers := yFilteredLines collect: [ :each | temp at: each ifAbsentPut: [ temp size ] ].
Expand Down

0 comments on commit 2d3c9d9

Please sign in to comment.