From 1ad4de5b08e5d9fde394380418dda6f909ff91b4 Mon Sep 17 00:00:00 2001 From: Pim van den Berg Date: Sat, 30 Mar 2013 14:08:23 +0100 Subject: rewrite some code of added overview_filter feature Use less variables, less code. --- inc/collectd.inc.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'inc') diff --git a/inc/collectd.inc.php b/inc/collectd.inc.php index e8f3662..ad15774 100644 --- a/inc/collectd.inc.php +++ b/inc/collectd.inc.php @@ -154,15 +154,12 @@ function graphs_from_plugin($host, $plugin, $overview=false) { $plugindata = group_plugindata($plugindata); $plugindata = plugin_sort($plugindata); - $f = array(); - - if ($overview == true && isset($CONFIG['overview_filter'][$plugin])) { - $f = $CONFIG['overview_filter'][$plugin]; - } - foreach ($plugindata as $items) { - if (!empty($f) && ($f !== array_intersect_assoc($f, $items))) { + if ( + $overview && isset($CONFIG['overview_filter'][$plugin]) && + $CONFIG['overview_filter'][$plugin] !== array_intersect_assoc($CONFIG['overview_filter'][$plugin], $items) + ) { continue; } -- cgit v1.1