Skip to content

Commit

Permalink
Refactor if/else statements
Browse files Browse the repository at this point in the history
  • Loading branch information
DigiLive authored and DigiLive committed Nov 19, 2020
1 parent 8a193c9 commit 5ba19f7
Showing 1 changed file with 17 additions and 18 deletions.
35 changes: 17 additions & 18 deletions lib/jblond/Diff/SequenceMatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,12 @@ private function chainB()
if ($length >= 200 && count($this->b2j[$char]) * 100 > $length) {
$popularDict[$char] = 1;
unset($this->b2j[$char]);
} else {
$this->b2j[$char][] = $i;
continue;
}
} else {
$this->b2j[$char] = [
$i,
];
$this->b2j[$char][] = $i;
continue;
}
$this->b2j[$char] = [$i];
}

// Remove leftovers
Expand Down Expand Up @@ -436,21 +434,22 @@ function ($aArray, $bArray) {
foreach ($matchingBlocks as [$list4, $list5, $list6]) {
if ($i1 + $k1 == $list4 && $j1 + $k1 == $list5) {
$k1 += $list6;
} else {
if ($k1) {
$nonAdjacent[] = [
$i1,
$j1,
$k1,
];
}

$i1 = $list4;
$j1 = $list5;
$k1 = $list6;
continue;
}
if ($k1) {
$nonAdjacent[] = [
$i1,
$j1,
$k1,
];
}

$i1 = $list4;
$j1 = $list5;
$k1 = $list6;
}


if ($k1) {
$nonAdjacent[] = [
$i1,
Expand Down

0 comments on commit 5ba19f7

Please sign in to comment.