]> git.xonotic.org Git - xonotic/xonotic.git/commitdiff
simplify cache structure
authorRudolf Polzer <divVerent@xonotic.org>
Fri, 19 Aug 2011 20:11:33 +0000 (22:11 +0200)
committerRudolf Polzer <divVerent@xonotic.org>
Fri, 19 Aug 2011 20:11:33 +0000 (22:11 +0200)
misc/tools/weapon-profiler-analyzer.pl

index bbd7b912ee9d7a83f3693fc50107734612414dee..f168983bee98641ddc7874c1f34ed0f09a397a10 100755 (executable)
@@ -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;
        }
 }