string.c: use raw macro

* string.c (str_new_frozen): use raw macro for RString object.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52070 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2015-10-07 08:30:20 +00:00
parent 907b6d32be
commit 8f4e6f14d8

View File

@ -1025,7 +1025,7 @@ str_new_frozen(VALUE klass, VALUE orig)
str = str_new(klass, RSTRING_PTR(orig), RSTRING_LEN(orig)); str = str_new(klass, RSTRING_PTR(orig), RSTRING_LEN(orig));
} }
else { else {
if (FL_TEST(orig, STR_SHARED)) { if (FL_TEST_RAW(orig, STR_SHARED)) {
VALUE shared = RSTRING(orig)->as.heap.aux.shared; VALUE shared = RSTRING(orig)->as.heap.aux.shared;
long ofs = RSTRING(orig)->as.heap.ptr - RSTRING(shared)->as.heap.ptr; long ofs = RSTRING(orig)->as.heap.ptr - RSTRING(shared)->as.heap.ptr;
long rest = RSTRING(shared)->as.heap.len - ofs - RSTRING(orig)->as.heap.len; long rest = RSTRING(shared)->as.heap.len - ofs - RSTRING(orig)->as.heap.len;