* include/ruby/ruby.h (RSTRING_END): trivial optimization.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2aa4d69d78
commit
22bd95ded4
@ -1,4 +1,6 @@
|
|||||||
Fri Oct 30 04:44:01 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Fri Oct 30 04:47:26 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* include/ruby/ruby.h (RSTRING_END): trivial optimization.
|
||||||
|
|
||||||
* string.c (rb_str_sub_bang): trivial optimization.
|
* string.c (rb_str_sub_bang): trivial optimization.
|
||||||
|
|
||||||
|
@ -619,7 +619,12 @@ struct RString {
|
|||||||
(!(RBASIC(str)->flags & RSTRING_NOEMBED) ? \
|
(!(RBASIC(str)->flags & RSTRING_NOEMBED) ? \
|
||||||
RSTRING(str)->as.ary : \
|
RSTRING(str)->as.ary : \
|
||||||
RSTRING(str)->as.heap.ptr)
|
RSTRING(str)->as.heap.ptr)
|
||||||
#define RSTRING_END(str) (RSTRING_PTR(str)+RSTRING_LEN(str))
|
#define RSTRING_END(str) \
|
||||||
|
(!(RBASIC(str)->flags & RSTRING_NOEMBED) ? \
|
||||||
|
(RSTRING(str)->as.ary + \
|
||||||
|
((RBASIC(str)->flags >> RSTRING_EMBED_LEN_SHIFT) & \
|
||||||
|
(RSTRING_EMBED_LEN_MASK >> RSTRING_EMBED_LEN_SHIFT))) : \
|
||||||
|
(RSTRING(str)->as.heap.ptr + RSTRING(str)->as.heap.len))
|
||||||
|
|
||||||
#define RARRAY_EMBED_LEN_MAX 3
|
#define RARRAY_EMBED_LEN_MAX 3
|
||||||
struct RArray {
|
struct RArray {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user