Skip to content

Commit

Permalink
Use result instead of tap
Browse files Browse the repository at this point in the history
  • Loading branch information
heka1024 committed Jan 26, 2024
1 parent da43474 commit 52f8d8e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/kredis/types/list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ def set_default
end

def with_expiration(&block)
block.call.tap do
if expires_in && ttl < 0
expire expires_in.to_i
end
result = block.call
if expires_in && ttl < 0
expire expires_in.to_i
end
result
end
end

0 comments on commit 52f8d8e

Please sign in to comment.