Commit a0e5302d authored by alexpott's avatar alexpott
Browse files

Issue #2287777 by andypost: Optimize _dblog_get_message_types().

parent eb2bfe7d
......@@ -87,14 +87,8 @@ function dblog_cron() {
* List of uniquely defined database log message types.
*/
function _dblog_get_message_types() {
$types = array();
$result = db_query('SELECT DISTINCT(type) FROM {watchdog} ORDER BY type');
foreach ($result as $object) {
$types[] = $object->type;
}
return array_combine($types, $types);
return db_query('SELECT DISTINCT(type) FROM {watchdog} ORDER BY type')
->fetchAllKeyed(0, 0);
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment