summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-01-15 12:05:46 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-01-15 12:05:46 +0000
commitd7976d145193379d8c43f33e9a5714292a40d994 (patch)
tree91b0975cbe29241078aba41607420adeed680a35 /string.c
parentd154bec0d5f0dd32e0d30559ab8a0a7ed8be98d2 (diff)
Use `&` instead of `modulo`
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66830 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/string.c b/string.c
index 2fbe36b1b8..ccf4796d3b 100644
--- a/string.c
+++ b/string.c
@@ -5421,7 +5421,7 @@ rb_str_setbyte(VALUE str, VALUE index, VALUE value)
pos += len;
VALUE v = rb_to_int(value);
- VALUE w = rb_int_modulo(v, INT2FIX(256));
+ VALUE w = rb_int_and(v, INT2FIX(0xff));
unsigned char byte = NUM2INT(w) & 0xFF;
if (!str_independent(str))