mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge pull request #5498 from dearblue/ruby-warns
Avoid warnings with `ruby -cw`
This commit is contained in:
@@ -386,7 +386,6 @@ class Array
|
||||
end
|
||||
|
||||
beg = len = 0
|
||||
ary = []
|
||||
if block
|
||||
if arg0.nil? && arg1.nil? && arg2.nil?
|
||||
# ary.fill { |index| block } -> ary
|
||||
@@ -660,7 +659,6 @@ class Array
|
||||
return to_enum :keep_if unless block
|
||||
|
||||
idx = 0
|
||||
len = self.size
|
||||
while idx < self.size do
|
||||
if block.call(self[idx])
|
||||
idx += 1
|
||||
|
||||
@@ -116,7 +116,6 @@ class Hash
|
||||
nk.each {|k|
|
||||
h[k] = self[k]
|
||||
}
|
||||
h
|
||||
self.replace(h)
|
||||
end
|
||||
|
||||
@@ -256,7 +255,6 @@ class Hash
|
||||
def keep_if(&block)
|
||||
return to_enum :keep_if unless block
|
||||
|
||||
keys = []
|
||||
self.each do |k, v|
|
||||
unless block.call([k, v])
|
||||
self.delete(k)
|
||||
|
||||
@@ -209,7 +209,7 @@ class IO
|
||||
end
|
||||
|
||||
array = []
|
||||
while 1
|
||||
while true
|
||||
begin
|
||||
_read_buf
|
||||
rescue EOFError
|
||||
@@ -256,7 +256,7 @@ class IO
|
||||
end
|
||||
|
||||
array = []
|
||||
while 1
|
||||
while true
|
||||
begin
|
||||
_read_buf
|
||||
rescue EOFError
|
||||
|
||||
@@ -344,8 +344,6 @@ class String
|
||||
end
|
||||
|
||||
def codepoints(&block)
|
||||
len = self.size
|
||||
|
||||
if block_given?
|
||||
self.split('').each do|x|
|
||||
block.call(x.ord)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
def self.include (*modules)
|
||||
def self.include(*modules)
|
||||
self.class.include(*modules)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user