From 8ca522f4ee3c49bdffd79792a86caf447a8ea9f5 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Wed, 30 Dec 2009 14:24:17 +0000 Subject: [PATCH] Remove pointless micro-optimizations in prepare_highlight_hash() and prepare_colour_array(). --- tools/privoxy-log-parser.pl | 34 +++++++++------------------------- 1 file changed, 9 insertions(+), 25 deletions(-) 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]); } } -- 2.39.2