MDL-33635 improve collatorlib::ksort() coding style and perf
Thanks Eloy Lafuente for spotting my sloppy coding style!
This commit is contained in:
@@ -872,10 +872,7 @@ class collatorlib {
|
||||
}
|
||||
// This is a bit slow, but we need to keep the references
|
||||
$original = $arr;
|
||||
$count = count($arr);
|
||||
for($i=0; $i<$count; $i++) {
|
||||
array_pop($arr);
|
||||
}
|
||||
$arr = array(); // Surprisingly this does not break references outside
|
||||
foreach ($keys as $key) {
|
||||
$arr[$key] = $original[$key];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user