From 066988d2f330961503a58dc139a8f10439575fdf Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 14 Mar 2005 23:38:45 +0000 Subject: Remove superfluous begin/end in caching.rb methods #836 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@908 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_controller/caching.rb | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'actionpack/lib/action_controller') diff --git a/actionpack/lib/action_controller/caching.rb b/actionpack/lib/action_controller/caching.rb index 46ef18c010..4c11bc99d8 100644 --- a/actionpack/lib/action_controller/caching.rb +++ b/actionpack/lib/action_controller/caching.rb @@ -292,11 +292,7 @@ module ActionController #:nodoc: end def read(name, options = {}) #:nodoc: - begin - @mutex.synchronize { @data[name] } - rescue - nil - end + @mutex.synchronize { @data[name] } rescue nil end def write(name, value, options = {}) #:nodoc: @@ -326,20 +322,14 @@ module ActionController #:nodoc: end def write(name, value, options = {}) #:nodoc: - begin - ensure_cache_path(File.dirname(real_file_path(name))) - File.open(real_file_path(name), "w+") { |f| f.write(value) } - rescue => e - Base.logger.info "Couldn't create cache directory: #{name} (#{e.message})" unless Base.logger.nil? - end + ensure_cache_path(File.dirname(real_file_path(name))) + File.open(real_file_path(name), "w+") { |f| f.write(value) } + rescue => e + Base.logger.info "Couldn't create cache directory: #{name} (#{e.message})" unless Base.logger.nil? end def read(name, options = {}) #:nodoc: - begin - IO.read(real_file_path(name)) - rescue - nil - end + IO.read(real_file_path(name)) rescue nil end def delete(name, options) #:nodoc: -- cgit v1.2.3