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

index 285eb34edfba131a09723641cc15bf0ebe146677..8761335c6fa82c575c003332491483042aa744b9 100644 (file)
@@ -75,6 +75,9 @@ M: string set-nth-unsafe
 M: string clone
     (clone) [ clone ] change-aux ; inline
 
+M: string clone-like
+    over string? [ drop clone ] [ call-next-method ] if ; inline
+
 M: string resize resize-string ; inline
 
 : 1string ( ch -- str ) 1 swap <string> ; inline