Skip to content

Commit 0f59163

Browse files
committed
Simplify condition checks
1 parent fd49d6a commit 0f59163

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

activerecord/lib/active_record/connection_adapters/sqlite3/database_statements.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def perform_query(raw_connection, sql, binds, type_casted_binds, prepare:, notif
104104
result = if stmt.column_count.zero? # No return
105105
stmt.step
106106

107-
affected_rows = if (raw_connection.total_changes - total_changes_before_query) > 0
107+
affected_rows = if raw_connection.total_changes > total_changes_before_query
108108
raw_connection.changes
109109
else
110110
0
@@ -114,7 +114,7 @@ def perform_query(raw_connection, sql, binds, type_casted_binds, prepare:, notif
114114
else
115115
rows = stmt.to_a
116116

117-
affected_rows = if (raw_connection.total_changes - total_changes_before_query) > 0
117+
affected_rows = if raw_connection.total_changes > total_changes_before_query
118118
raw_connection.changes
119119
else
120120
0

0 commit comments

Comments
 (0)