From 8574b25a96721bca55dbacf4ebfef85d4d243101 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Mon, 22 Apr 2013 06:24:02 -0700 Subject: [PATCH] tools.profiler.sampling: don't mis-use collect-by. --- basis/tools/profiler/sampling/sampling.factor | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/basis/tools/profiler/sampling/sampling.factor b/basis/tools/profiler/sampling/sampling.factor index d6947f1dad..c8e93de388 100644 --- a/basis/tools/profiler/sampling/sampling.factor +++ b/basis/tools/profiler/sampling/sampling.factor @@ -101,7 +101,9 @@ CONSTANT: zero-counts { 0 0 0 0 0 } ] [ f ] if ; inline :: collect-tops ( samples max-depth depth -- node ) - samples [ drop unclip-callstack ] collect-by [ + samples H{ } clone [ + '[ unclip-callstack _ push-at ] each + ] keep [ [ sum-counts ] [ max-depth depth [ max-depth depth 1 + collect-tops ] (collect-subtrees) ] bi depth