diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2018-11-19 12:01:34 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2018-11-19 12:08:28 +0900 |
| commit | c022e4643f2b6c84cb3f1ca716c0e7da3f14c8ca (patch) | |
| tree | 236c48aaa661b6f3772c7039b781b0ae65d84784 /mrblib/string.rb | |
| parent | 610bcc88c2b4f3ca9bbfebb57279c25806fa0461 (diff) | |
| download | mruby-c022e4643f2b6c84cb3f1ca716c0e7da3f14c8ca.tar.gz mruby-c022e4643f2b6c84cb3f1ca716c0e7da3f14c8ca.zip | |
Avoid assignments from type checking `String#__to_str`.
Diffstat (limited to 'mrblib/string.rb')
| -rw-r--r-- | mrblib/string.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mrblib/string.rb b/mrblib/string.rb index 397603e9d..64e85c5b6 100644 --- a/mrblib/string.rb +++ b/mrblib/string.rb @@ -12,7 +12,7 @@ class String def each_line(rs = "\n", &block) return to_enum(:each_line, rs, &block) unless block return block.call(self) if rs.nil? - rs = rs.__to_str + rs.__to_str offset = 0 rs_len = rs.length this = dup @@ -67,7 +67,7 @@ class String block = nil end if !replace.nil? || !block - replace = replace.__to_str + replace.__to_str end offset = 0 result = [] @@ -129,12 +129,12 @@ class String end pattern, replace = *args - pattern = pattern.__to_str + pattern.__to_str if args.length == 2 && block block = nil end unless block - replace = replace.__to_str + replace.__to_str end result = [] this = dup |
