]> git.etc.gen.nz Git - mythtv-status.git/commitdiff
If there are no items for a block, skip everything about that block.
authorAndrew Ruthven <andrew@cerberus.etc.gen.nz>
Fri, 12 Oct 2007 01:40:26 +0000 (14:40 +1300)
committerAndrew Ruthven <andrew@cerberus.etc.gen.nz>
Fri, 12 Oct 2007 01:40:26 +0000 (14:40 +1300)
bin/status.pl

index bfa10933131a8322d6e2f0623cfcb6bf5a634e60..d7e737142729a74beb1ad5bd880fdaff17ade9fd 100755 (executable)
@@ -77,8 +77,11 @@ my @blocks = (
 for my $block (@blocks) {
   my $items = $xml->documentElement->find($block->{'xpath'});
 
-  print "$block->{'name'}:\n"
-    if (scalar(@$items) > 0);
+  # Don't do any work on this block if there is nothing for it.
+  next
+    if (scalar(@$items) == 0);
+
+  print "$block->{'name'}:\n";
 
   for my $item (@{ $items }) {
     my $template = $block->{'template'};