Merge pull request #31004 from shuheiktgw/remove_unnecessary_returns

Remove redundant return statements
This commit is contained in:
Rafael França 2017-10-31 01:47:35 -04:00 committed by GitHub
commit a8ebd48559
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 16 additions and 16 deletions

View File

@ -198,7 +198,7 @@ end
class CacheHelperOutputBufferTest < BaseCachingTest
class MockController
def read_fragment(name, options)
return false
false
end
def write_fragment(name, fragment, options)

View File

@ -61,7 +61,7 @@ module ActionDispatch
return [status, headers, body]
end
return [404, { "X-Cascade" => "pass" }, ["Not Found"]]
[404, { "X-Cascade" => "pass" }, ["Not Found"]]
end
def recognize(rails_req)

View File

@ -317,7 +317,7 @@ end
class CacheHelperOutputBufferTest < ActionController::TestCase
class MockController
def read_fragment(name, options)
return false
false
end
def write_fragment(name, fragment, options)

View File

@ -422,7 +422,7 @@ module ActionView
def to_s
value = @values[@index].to_s
@index = next_index
return value
value
end
private
@ -446,7 +446,7 @@ module ActionView
# uses an instance variable of ActionView::Base.
def get_cycle(name)
@_cycles = Hash.new unless defined?(@_cycles)
return @_cycles[name]
@_cycles[name]
end
def set_cycle(name, cycle_object)

View File

@ -77,7 +77,7 @@ module Delayed
self.locked_by = worker
end
return true
true
end
def self.db_time_now

View File

@ -236,7 +236,7 @@ module ActiveRecord
return has_attribute?(name)
end
return true
true
end
# Returns +true+ if the given attribute is in the attributes hash, otherwise +false+.

View File

@ -53,7 +53,7 @@ module ActiveRecord
unscoped.where(primary_key => object.id).update_all(updates)
end
return true
true
end
# A generic "counter updater" implementation, intended primarily to be

View File

@ -113,7 +113,7 @@ module ActiveSupport
def append_features(base)
if base.instance_variable_defined?(:@_dependencies)
base.instance_variable_get(:@_dependencies) << self
return false
false
else
return false if base < self
@_dependencies.each { |dep| base.include(dep) }

View File

@ -615,7 +615,7 @@ module ActiveSupport #:nodoc:
return false if desc.is_a?(Module) && desc.anonymous?
name = to_constant_name desc
return false unless qualified_const_defined?(name)
return autoloaded_constants.include?(name)
autoloaded_constants.include?(name)
end
# Will the provided constant descriptor be unloaded?

View File

@ -118,7 +118,7 @@ module ActiveSupport
raise_parsing_error "(only last part can be fractional)"
end
return true
true
end
end
end

View File

@ -55,7 +55,7 @@ module ActiveSupport
write.close
result = read.read
Process.wait2(pid)
return result.unpack("m")[0]
result.unpack("m")[0]
end
end

View File

@ -6,22 +6,22 @@ require "active_support/core_ext/module/remove_method"
module RemoveMethodTests
class A
def do_something
return 1
1
end
def do_something_protected
return 1
1
end
protected :do_something_protected
def do_something_private
return 1
1
end
private :do_something_private
class << self
def do_something_else
return 2
2
end
end
end