From dde62bcd2efbb3825d982326896ab774e73e4218 Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 17 Jan 2000 08:37:53 +0000 Subject: 2000-01-17 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- string.c | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) (limited to 'string.c') diff --git a/string.c b/string.c index e1f213496a..635bbcf18f 100644 --- a/string.c +++ b/string.c @@ -863,7 +863,7 @@ rb_str_replace(str, beg, len, val) if (RSTRING(str)->len < beg && len < 0) { MEMZERO(RSTRING(str)->ptr + RSTRING(str)->len, char, -len); } - memcpy(RSTRING(str)->ptr+beg, RSTRING(val)->ptr, RSTRING(val)->len); + memmove(RSTRING(str)->ptr+beg, RSTRING(val)->ptr, RSTRING(val)->len); RSTRING(str)->len += RSTRING(val)->len - len; RSTRING(str)->ptr[RSTRING(str)->len] = '\0'; } @@ -2193,32 +2193,6 @@ rb_str_each_line(argc, argv, str) return str; } -#ifdef STR_TO_A_USE_EACH -static VALUE -to_a_push(str, ary) - VALUE str, ary; -{ - return rb_ary_push(ary, str); -} -#endif - -static VALUE -rb_str_to_a(str) - VALUE str; -{ -#ifdef STR_TO_A_USE_EACH - VALUE ary; - - if (RSTRING(str)->len == 0) return rb_ary_new3(1, str); - ary = rb_ary_new(); - rb_iterate(rb_each, str, to_a_push, ary); - - return ary; -#else - return rb_ary_new3(1, str); -#endif -} - static VALUE rb_str_each_byte(str) VALUE str; @@ -2652,7 +2626,6 @@ Init_String() rb_define_method(rb_cString, "to_i", rb_str_to_i, 0); rb_define_method(rb_cString, "to_f", rb_str_to_f, 0); - rb_define_method(rb_cString, "to_a", rb_str_to_a, 0); rb_define_method(rb_cString, "to_s", rb_str_to_s, 0); rb_define_method(rb_cString, "to_str", rb_str_to_s, 0); rb_define_method(rb_cString, "inspect", rb_str_inspect, 0); -- cgit v1.2.3