Skip to content

Commit ef86539

Browse files
committed
Faster array combine in fortunes
1 parent 5987d5a commit ef86539

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

frameworks/PHP/duckphp/app/Model/FortuneModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public function getFortunes()
1515
{
1616
$sql = 'SELECT id, message FROM fortune';
1717
$data = M::DB()->fetchAll($sql);
18-
$ret = array_combine(array_column($data,'id'),array_column($data,'message'));
18+
$ret = array_column($data, 'message', 'id');
1919
$ret[0] = 'Additional fortune added at request time.';
2020
asort($ret);
2121
return $ret;

0 commit comments

Comments
 (0)