From 938a6d68ab054f0634b2c42c0e9576de898e2206 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Tue, 25 Jun 2013 15:39:34 -0700 Subject: [PATCH] strings: faster clone-like when both arguments are strings. --- core/strings/strings.factor | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/strings/strings.factor b/core/strings/strings.factor index 285eb34edf..8761335c6f 100644 --- a/core/strings/strings.factor +++ b/core/strings/strings.factor @@ -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 ; inline