Permalink
Browse files

refactor if / else to ||=

  • Loading branch information...
tenderlove committed Aug 19, 2010
1 parent 6fb6ddb commit a16ec2f4cffc9bc9bc1307f27eed3a43a5036ee2
@@ -93,11 +93,7 @@ def initialize(spec)
# #connection can be called any number of times; the connection is
# held in a hash keyed by the thread id.
def connection
- if conn = @reserved_connections[current_connection_id]
- conn
- else
- @reserved_connections[current_connection_id] = checkout
- end
+ @reserved_connections[current_connection_id] ||= checkout
end
# Signal that the thread is finished with the current connection.

0 comments on commit a16ec2f

Please sign in to comment.