From: Fabian Keil Date: Wed, 30 Dec 2009 14:24:17 +0000 (+0000) Subject: Remove pointless micro-optimizations in prepare_highlight_hash() and prepare_colour_a... X-Git-Tag: v_3_0_16~89 X-Git-Url: http://www.privoxy.org/gitweb/?a=commitdiff_plain;h=8ca522f4ee3c49bdffd79792a86caf447a8ea9f5;p=privoxy.git Remove pointless micro-optimizations in prepare_highlight_hash() and prepare_colour_array(). --- diff --git a/tools/privoxy-log-parser.pl b/tools/privoxy-log-parser.pl index 04363f4a..f108f79d 100755 --- a/tools/privoxy-log-parser.pl +++ b/tools/privoxy-log-parser.pl @@ -8,7 +8,7 @@ # # http://www.fabiankeil.de/sourcecode/privoxy-log-parser/ # -# $Id: privoxy-log-parser.pl,v 1.214 2009/12/30 14:08:09 fk Exp $ +# $Id: privoxy-log-parser.pl,v 1.215 2009/12/30 14:23:44 fk Exp $ # # TODO: # - LOG_LEVEL_CGI, LOG_LEVEL_ERROR, LOG_LEVEL_WRITE content highlighting @@ -523,36 +523,20 @@ sub get_background (){ sub prepare_highlight_hash ($) { my $ref = shift; - if (!$html_output_mode) { - - foreach my $key (keys %$ref) { - $$ref{$key} = paint_it($$ref{$key}); - } - - } else { - - foreach my $key (keys %$ref) { - $$ref{$key} = get_semantic_html_markup($key); - } - + foreach my $key (keys %$ref) { + $$ref{$key} = $html_output_mode ? + get_semantic_html_markup($key) : + paint_it($$ref{$key}); } } sub prepare_colour_array ($) { my $ref = shift; - if (!$html_output_mode) { - - foreach my $i (0 ... @$ref - 1) { - $$ref[$i] = paint_it($$ref[$i]); - } - - } else { - - foreach my $i (0 ... @$ref - 1) { - $$ref[$i] = get_colour_html_markup($$ref[$i]); - } - + foreach my $i (0 ... @$ref - 1) { + $$ref[$i] = $html_output_mode ? + get_colour_html_markup($$ref[$i]) : + paint_it($$ref[$i]); } }