From ed26e0e57a413e6f903406999f16d1e07b61efa4 Mon Sep 17 00:00:00 2001 From: Slaven Rezic Date: Fri, 30 Apr 2010 17:31:38 +0200 Subject: [PATCH] * fix in package_size: do not count file lexicals multiple times --- lib/B/TerseSize.pm | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/B/TerseSize.pm b/lib/B/TerseSize.pm index 444ea94..f4bbfe9 100644 --- a/lib/B/TerseSize.pm +++ b/lib/B/TerseSize.pm @@ -124,10 +124,13 @@ sub package_size { CV_walk('slow', $name, 'op_size'); for (keys %{ $filelex{$package} }) { - my $fsize = $filelex{$package}->{$_}; - $total_opsize += $fsize; - $retval{"my ${_} = ...;"} = - {'size' => $fsize}; + my $filelex_key = "my ${_} = ...;"; + if (!exists $retval{$filelex_key}) { + my $fsize = $filelex{$package}->{$_}; + $total_opsize += $fsize; + $retval{$filelex_key} = + {'size' => $fsize}; + } } %filelex = (); $total_opsize += $opsize; -- 1.7.0.3