mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Refactor Enumerable#include?
This commit is contained in:
+2
-4
@@ -176,14 +176,12 @@ module Enumerable
|
||||
#
|
||||
# ISO 15.3.2.2.10
|
||||
def include?(obj)
|
||||
st = false
|
||||
self.each{|val|
|
||||
if val == obj
|
||||
st = true
|
||||
break
|
||||
return true
|
||||
end
|
||||
}
|
||||
st
|
||||
false
|
||||
end
|
||||
|
||||
##
|
||||
|
||||
Reference in New Issue
Block a user