]> gitweb.factorcode.org Git - factor.git/commitdiff
byte-arrays: faster clone-like when both arguments are byte-arrays.
authorJohn Benediktsson <mrjbq7@gmail.com>
Tue, 25 Jun 2013 22:39:24 +0000 (15:39 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Tue, 25 Jun 2013 22:39:24 +0000 (15:39 -0700)
core/byte-arrays/byte-arrays.factor

index 85bf0c45dafffb337b2badcdbc8dc55c74a4772e..d5d61c2980d185b037debe2004056a0db56afc44 100644 (file)
@@ -8,6 +8,8 @@ BUILTIN: byte-array
 { length array-capacity read-only initial: 0 } ;
 
 M: byte-array clone (clone) ; inline
+M: byte-array clone-like
+    over byte-array? [ drop clone ] [ call-next-method ] if ; inline
 M: byte-array length length>> ; inline
 M: byte-array nth-unsafe swap integer>fixnum alien-unsigned-1 ; inline
 M: byte-array set-nth-unsafe swap integer>fixnum set-alien-unsigned-1 ; inline