Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
c022e464
Commit
c022e464
authored
6 years ago
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid assignments from type checking `String#__to_str`.
parent
610bcc88
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
mrblib/string.rb
mrblib/string.rb
+4
-4
No files found.
mrblib/string.rb
View file @
c022e464
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment