Skip to content

Commit 3c05022

Browse files
committed
Use coalesce for $avail[$char]
1 parent c09edb2 commit 3c05022

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
### Composer ###
66
composer.phar
77
/vendor/
8+
/composer.lock
9+
/.phpunit.result.cache
10+
811

912
# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
1013
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
@@ -72,4 +75,3 @@ local.properties
7275

7376

7477
# End of https://www.gitignore.io/api/windows,eclipse,composer
75-
/composer.lock

lib/jblond/Diff/Similarity.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ private function getRatioFast(): float
106106
$aLength = count($this->old);
107107
for ($iterator = 0; $iterator < $aLength; ++$iterator) {
108108
$char = $this->old[$iterator];
109-
$numb = isset($avail[$char]) ? $avail[$char] : $this->uniqueCount2[$char] ?? 0;
109+
$numb = $avail[$char] ?? ($this->uniqueCount2[$char] ?? 0);
110110
$avail[$char] = $numb - 1;
111111
if ($numb > 0) {
112112
++$matches;

0 commit comments

Comments
 (0)