]> gitweb.factorcode.org Git - factor.git/commitdiff
sequences: adding a subseq-unsafe that doesn't check slice bounds.
authorJohn Benediktsson <mrjbq7@gmail.com>
Fri, 17 Jul 2015 06:42:56 +0000 (23:42 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Fri, 17 Jul 2015 19:14:33 +0000 (12:14 -0700)
basis/hints/hints.factor
core/sequences/sequences.factor

index 3dc8dff936880a1a282788345bff9ffd31901d84..b5b41603d263f90e651c3b81648b90034f4a00d5 100644 (file)
@@ -4,8 +4,8 @@ USING: accessors arrays assocs byte-arrays byte-vectors classes
 combinators definitions effects fry generic generic.single
 generic.standard hashtables io.binary io.encodings
 io.streams.string kernel kernel.private math math.parser
-namespaces parser sbufs sequences splitting splitting.private
-strings vectors words ;
+namespaces parser sbufs sequences sequences.private splitting
+splitting.private strings vectors words ;
 IN: hints
 
 GENERIC: specializer-predicate ( spec -- quot )
@@ -95,9 +95,10 @@ set-specializer
     set-specializer
 ] each
 
-\ subseq
-{ { fixnum fixnum string } { fixnum fixnum array } }
-set-specializer
+{ subseq subseq-unsafe } [
+    { { fixnum fixnum string } { fixnum fixnum array } }
+    set-specializer
+] each
 
 \ reverse!
 { { string } { array } }
index 018efc85d1a2ee38664dc80575152eb7d273f301..020f2fcfa7e84a15c42167bd0b77f714d07f547a 100644 (file)
@@ -311,6 +311,9 @@ C: <copy> copy-state
     #! The check-length call forces partial dispatch
     [ [ length check-length 0 ] keep ] 2dip <copy> (copy) drop ; inline
 
+: subseq-unsafe ( from to seq -- subseq )
+    [ subseq>copy (copy) ] keep like ;
+
 PRIVATE>
 
 : subseq ( from to seq -- subseq )