diff --git a/CHANGELOG.md b/CHANGELOG.md index 703509e..cb86647 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ * ENHANCEMENT: `Class::getBinaryData` methods return null if field is non-existent * CHANGE: `Tournament::getArbiter` accepts a `int` parameter representing the order of the arbiters * BUGFIX: `Player:GetId` returns elo instead of id -* BUGFIX: `Tournament::CalculateBuchholz` did not return the correct score when player had onplayed rounds +* BUGFIX: `Tournament::CalculateBuchholz` did not return the correct score when player had unplayed rounds ## v1.1.2 (Release: 21-jun-2019) * ENHANCEMENT: Added update section to dist/readme.md diff --git a/src/Tournament.php b/src/Tournament.php index 1e1bb3b..c0a4670 100644 --- a/src/Tournament.php +++ b/src/Tournament.php @@ -742,10 +742,7 @@ class Tournament $intpairings = array_slice($intpairings, $cutlowest); $intpairings = array_slice($intpairings, 0 - $cuthighest); - foreach ($intpairings as $intkey => $intpairing) { - $tiebreak += $intpairing; - } - return $tiebreak; + return array_sum($intpairings); }