Bug patch. The bug is that if you have any profile() calls with a
begin => but no end => and you call ->report() multiple
times, profile() will throw garbage items into the Tree::Simple.
By removing the map() from Stats.pm the bug no longer occurs.
I added a test item which fails until the Stats.pm patch is applied.
To see the bug in action, uncomment the print scalar($stats->report);
line I added without the Stats.pm patch applied. You'll see ugly blank
lines show up in the report().
You can also see that begin => with no end => works fine without
the map() code. The map actually breaks it, it doesn't fix anything as
far as I can tell.
Possibly cleaner would be to patch profile() so that the garbage can
never happen, but I spent several hours on that and couldn't track it
down. This solves the problem and all tests pass. And removes code that
does nothing.
Cheers,
jhannah
jay(at)jays(dot)net