diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-19 07:06:54 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-19 07:06:54 +0000 |
commit | 72c773b15dd65740807fb93cbd012a8367e738dc (patch) | |
tree | 9e1d1994e390c04a64e08265c268f3fc4be2bdc1 /string.c | |
parent | 442879eb57187d899f7c14d91ef90e55d3cdcafd (diff) |
string.c: constify
* string.c (rb_str_index): constify local pointer variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46012 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -2572,7 +2572,7 @@ rb_str_casecmp(VALUE str1, VALUE str2) static long rb_str_index(VALUE str, VALUE sub, long offset) { - char *s, *sptr, *e; + const char *s, *sptr, *e; long pos, len, slen; int single_byte = single_byte_optimizable(str); rb_encoding *enc; @@ -2600,7 +2600,7 @@ rb_str_index(VALUE str, VALUE sub, long offset) slen = RSTRING_LEN(sub); len = RSTRING_LEN(str) - offset; for (;;) { - char *t; + const char *t; pos = rb_memsearch(sptr, slen, s, len, enc); if (pos < 0) return pos; t = rb_enc_right_char_head(s, s+pos, e, enc); |