Skip to content

Commit b4cfbd5

Browse files
committed
Merge branch 'midas104/8.x' into 8.x
2 parents bf28535 + d2b27d0 commit b4cfbd5

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/Illuminate/Database/DatabaseTransactionsManager.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ public function rollback($connection, $level)
5858
*/
5959
public function commit($connection)
6060
{
61-
$this->transactions = $this->transactions->reject(function ($transaction) use ($connection) {
62-
if ($transaction->connection == $connection) {
63-
$transaction->executeCallbacks();
64-
65-
return true;
61+
[$forThisConnection, $forOtherConnections] = $this->transactions->partition(
62+
function ($transaction) use ($connection) {
63+
return $transaction->connection == $connection;
6664
}
65+
);
6766

68-
return false;
69-
})->values();
67+
$this->transactions = $forOtherConnections->values();
68+
69+
$forThisConnection->map->executeCallbacks();
7070
}
7171

7272
/**

0 commit comments

Comments
 (0)