From 218d1cdd315483f3bc85ab55ab8dc82107a0ee33 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Fri, 2 Oct 2009 01:23:17 -0500 Subject: [PATCH] prettyprint.backend: fix performance problem when printing large arrays with length limit on --- basis/prettyprint/backend/backend.factor | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/basis/prettyprint/backend/backend.factor b/basis/prettyprint/backend/backend.factor index fb47c50fbe..f919573ea9 100644 --- a/basis/prettyprint/backend/backend.factor +++ b/basis/prettyprint/backend/backend.factor @@ -169,11 +169,10 @@ M: tuple pprint* : do-length-limit ( seq -- trimmed n/f ) length-limit get dup [ over length over [-] - dup zero? [ 2drop f ] [ [ head ] dip ] if + dup zero? [ 2drop f ] [ [ head-slice ] dip ] if ] when ; : pprint-elements ( seq -- ) - >array do-length-limit [ [ pprint* ] each ] dip [ "~" swap number>string " more~" 3append text ] when* ;