提交 c40b4428 编写于 作者: S Shuhei Kitagawa

removed unnecessary returns

上级 bf6456e0
......@@ -198,7 +198,7 @@ def template_digest(name)
class CacheHelperOutputBufferTest < BaseCachingTest
class MockController
def read_fragment(name, options)
return false
false
end
def write_fragment(name, fragment, options)
......
......@@ -61,7 +61,7 @@ def serve(req)
return [status, headers, body]
end
return [404, { "X-Cascade" => "pass" }, ["Not Found"]]
[404, { "X-Cascade" => "pass" }, ["Not Found"]]
end
def recognize(rails_req)
......
......@@ -317,7 +317,7 @@ def template_digest(name)
class CacheHelperOutputBufferTest < ActionController::TestCase
class MockController
def read_fragment(name, options)
return false
false
end
def write_fragment(name, fragment, options)
......
......@@ -422,7 +422,7 @@ def current_value
def to_s
value = @values[@index].to_s
@index = next_index
return value
value
end
private
......@@ -446,7 +446,7 @@ def step_index(n)
# 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)
......
......@@ -77,7 +77,7 @@ def lock_exclusively!(max_run_time, worker)
self.locked_by = worker
end
return true
true
end
def self.db_time_now
......
......@@ -236,7 +236,7 @@ def respond_to?(name, include_private = false)
return has_attribute?(name)
end
return true
true
end
# Returns +true+ if the given attribute is in the attributes hash, otherwise +false+.
......
......@@ -53,7 +53,7 @@ def reset_counters(id, *counters, touch: nil)
unscoped.where(primary_key => object.id).update_all(updates)
end
return true
true
end
# A generic "counter updater" implementation, intended primarily to be
......
......@@ -113,7 +113,7 @@ def self.extended(base) #:nodoc:
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) }
......
......@@ -615,7 +615,7 @@ def autoloaded?(desc)
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?
......
......@@ -118,7 +118,7 @@ def validate!
raise_parsing_error "(only last part can be fractional)"
end
return true
true
end
end
end
......
......@@ -55,7 +55,7 @@ def run_in_isolation(&blk)
write.close
result = read.read
Process.wait2(pid)
return result.unpack("m")[0]
result.unpack("m")[0]
end
end
......
......@@ -6,22 +6,22 @@
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册