From 8230ee411d3afd8c9daaf31895c2368d01d23210 Mon Sep 17 00:00:00 2001 From: Kevin Ryde Date: Fri, 24 Jun 2005 21:53:10 +0000 Subject: [PATCH] (scm_string_filter, scm_string_delete): Partial revert last change, use plain copy-on-write substrings, the individual descriptions in the srfi don't mention shared storage (only the introduction does). --- libguile/srfi-13.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/libguile/srfi-13.c b/libguile/srfi-13.c index 1d8a675ab..d0c626231 100644 --- a/libguile/srfi-13.c +++ b/libguile/srfi-13.c @@ -3283,10 +3283,12 @@ SCM_DEFINE (scm_string_filter, "string-filter", 2, 2, 0, if (cstr[idx] == chr) count++; - /* if whole of start to end kept then return substring, including - possibly s itself */ + /* if whole of start to end kept then return substring */ if (count == cend - cstart) - result = scm_i_substring_shared (s, cstart, cend); + { + result_substring: + result = scm_i_substring (s, cstart, cend); + } else result = scm_c_make_string (count, char_pred); } @@ -3300,10 +3302,9 @@ SCM_DEFINE (scm_string_filter, "string-filter", 2, 2, 0, if (SCM_CHARSET_GET (char_pred, cstr[idx])) count++; - /* if whole of start to end kept then return substring, including - possibly s itself */ + /* if whole of start to end kept then return substring */ if (count == cend - cstart) - result = scm_i_substring_shared (s, cstart, cend); + goto result_substring; else { char *dst; @@ -3380,12 +3381,11 @@ SCM_DEFINE (scm_string_delete, "string-delete", 2, 2, 0, if (cstr[idx] != chr) count++; - /* if whole of start to end kept then return substring, including - possibly s itself */ + /* if whole of start to end kept then return substring */ if (count == cend - cstart) { result_substring: - result = scm_i_substring_shared (s, cstart, cend); + result = scm_i_substring (s, cstart, cend); } else {