Issue #2287777 by andypost: Optimize _dblog_get_message_types().

8.0.x
Alex Pott 2014-07-10 11:00:19 +01:00
parent eb2bfe7d49
commit a0e5302dba
1 changed files with 2 additions and 8 deletions

View File

@ -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);
}
/**