mirror of
https://github.com/danog/psalm.git
synced 2024-11-27 04:45:20 +01:00
assign keys to variable for better performance
improves performance by ~1-1.5%
This commit is contained in:
parent
4048bb9d8b
commit
57239a7c8e
@ -136,6 +136,7 @@ class Algebra
|
||||
if (!$clause_a->reconcilable || $clause_a->wedge) {
|
||||
continue;
|
||||
}
|
||||
$clause_a_keys = array_keys($clause_a->possibilities);
|
||||
|
||||
if (count($clause_a->possibilities) !== 1 || count(array_values($clause_a->possibilities)[0]) !== 1) {
|
||||
foreach ($cloned_clauses as $clause_b) {
|
||||
@ -143,7 +144,7 @@ class Algebra
|
||||
continue;
|
||||
}
|
||||
|
||||
if (array_keys($clause_a->possibilities) === array_keys($clause_b->possibilities)) {
|
||||
if ($clause_a_keys === array_keys($clause_b->possibilities)) {
|
||||
$opposing_keys = [];
|
||||
|
||||
foreach ($clause_a->possibilities as $key => $a_possibilities) {
|
||||
|
Loading…
Reference in New Issue
Block a user