Skip to content

Commit

Permalink
use unless instead of if not.
Browse files Browse the repository at this point in the history
  • Loading branch information
matz committed Jun 21, 2017
1 parent d0a7e01 commit 057be5f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion mrbgems/mruby-enum-lazy/mrblib/lazy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def select(&block)

def reject(&block)
Lazy.new(self){|yielder, val|
if not block.call(val)
unless block.call(val)
yielder << val
end
}
Expand Down
2 changes: 1 addition & 1 deletion mrblib/string.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def sub(*args, &block)
if args.length == 2 && block
block = nil
end
if !block
unless block
replace = replace.to_str
end
result = []
Expand Down
2 changes: 1 addition & 1 deletion test/assert.rb
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def assert_raise(*exp)
msg = "#{msg}#{exp.inspect} exception expected, not"
diff = " Class: <#{e.class}>\n" +
" Message: #{e.message}"
if not exp.any?{|ex| ex.instance_of?(Module) ? e.kind_of?(ex) : ex == e.class }
unless exp.any?{|ex| ex.instance_of?(Module) ? e.kind_of?(ex) : ex == e.class }
$mrbtest_assert.push([$mrbtest_assert_idx, msg, diff])
ret = false
end
Expand Down

0 comments on commit 057be5f

Please sign in to comment.