From 8b1a391dfa525224e562f50b45929dd9909e0d6d Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Fri, 19 Aug 2011 22:11:33 +0200 Subject: [PATCH 1/1] simplify cache structure --- misc/tools/weapon-profiler-analyzer.pl | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/misc/tools/weapon-profiler-analyzer.pl b/misc/tools/weapon-profiler-analyzer.pl index bbd7b912..f168983b 100755 --- a/misc/tools/weapon-profiler-analyzer.pl +++ b/misc/tools/weapon-profiler-analyzer.pl @@ -302,21 +302,24 @@ sub out_html_cache($@) { # open out file my ($addr, $type, $map, @columns) = @data; - $addr ||= ':any'; - $type ||= ':any'; - $map ||= ':any'; - mkdir "$type"; - mkdir "$type/$map"; - open $out_html_cache_fh, ">", "$type/$map/$addr" - or warn "open $type/$map/$addr: $!"; - select $out_html_cache_fh; + if(!defined $addr) + { + $type ||= ':any'; + $map ||= ':any'; + mkdir "$type"; + open $out_html_cache_fh, ">", "$type/$map" + or warn "open $type/$map: $!"; + select $out_html_cache_fh; + } } - out_html($event, @data); + out_html($event, @data) + if defined $out_html_cache_fh; if($event eq 'endmatrix') { # close out file select STDOUT; close $out_html_cache_fh; + undef $out_html_cache_fh; } } -- 2.39.2