REFACTOR: remove unnecessary parentheses attempt 2 (follow-up on 154f503d)

REFACTOR: remove unnecessary parentheses attempt 2 (follow-up on 154f503d)

diff --git a/app/models/post.rb b/app/models/post.rb
index 8e03538..0441bcb 100644
--- a/app/models/post.rb
+++ b/app/models/post.rb
@@ -215,8 +215,7 @@ class Post < ActiveRecord::Base
   end
 
   def matches_recent_post?
-    post_id = $redis.get(unique_post_key)
-    post_id != (nil) && post_id.to_i != (id)
+    $redis.get(unique_post_key)&.to_i != id
   end
 
   def raw_hash

GitHub sha: 7db2dc71

1 Like

:+1:

Revert "REFACTOR: remove unnecessary parentheses attempt 2 (follow-up on 154f503d)"