     dupd fuzzy score max ;
 
 : completion ( short candidate -- result )
-    [ second swap complete ] keep 2array ;
+    [ second swap complete ] keep 2array ; inline
 
 : completion, ( short candidate -- )
-    completion dup first 0 > [ , ] [ drop ] if ;
+    completion dup first-unsafe 0 > [ , ] [ drop ] if ;
 
 : completions ( short candidates -- seq )
     [ ] [

! Copyright (C) 2005, 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.

USING: accessors arrays assocs colors.constants combinators
combinators.short-circuit fry io.directories io.files
io.files.info io.pathnames kernel locals make math math.order
sequences sorting splitting unicode.categories unicode.data
vectors vocabs vocabs.hierarchy ;

IN: tools.completion


: rank-completions ( results -- newresults )
    sort-keys <reversed>
    [ 0 [ first max ] reduce 3 /f ] keep
    [ first-unsafe < ] with filter
    values ;

: complete ( full short -- score )
