From a1567bb01c53f2c86efdc8d16bc4be417c99b729 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Tue, 25 Jun 2013 15:39:24 -0700 Subject: [PATCH] byte-arrays: faster clone-like when both arguments are byte-arrays. --- core/byte-arrays/byte-arrays.factor | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/byte-arrays/byte-arrays.factor b/core/byte-arrays/byte-arrays.factor index 85bf0c45da..d5d61c2980 100644 --- a/core/byte-arrays/byte-arrays.factor +++ b/core/byte-arrays/byte-arrays.factor @@ -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