Added SizeAll cop and fixed conflicts
What does this MR do?
Adds the Performance/SizeAll
cop and also fixes all the conflicts. This cop enforces to use size
instead of count
.
For objects like Array
or Hash
, it does not make any difference. Nevertheless, for ActiveRecord
relations, it does. count
always performs a COUNT
query in the database, while, if the relationship is loaded, size
will avoid that request, and return the Enumerable
size.