Skip to content

Commit 73a5f79

Browse files
committed
revert conditionals to master
1 parent 4e32262 commit 73a5f79

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

lib/rack/session/abstract/id.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ def commit_session(req, res)
372372

373373
if options[:drop] || options[:renew]
374374
session_id = delete_session(req, session.id || generate_sid, options)
375-
return if session_id.nil?
375+
return unless session_id
376376
end
377377

378378
return unless commit_session?(req, session, options)

lib/rack/session/memcache.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def generate_sid
4848

4949
def get_session(env, sid)
5050
with_lock(env) do
51-
unless !sid.nil? and session = @pool.get(sid.private_id)
51+
unless sid and session = @pool.get(sid.private_id)
5252
sid, session = generate_sid, {}
5353
unless /^STORED/ =~ @pool.add(sid.private_id, session)
5454
raise "Session collision on '#{sid.inspect}'"

lib/rack/session/pool.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def generate_sid
4343

4444
def find_session(req, sid)
4545
with_lock(req) do
46-
unless !sid.nil? and session = @pool[sid.private_id]
46+
unless sid and session = @pool[sid.private_id]
4747
sid, session = generate_sid, {}
4848
@pool.store sid.private_id, session
4949
end

0 commit comments

Comments
 (0)