Project

General

Profile

Actions

Patch #26728

closed

count > 0 vs exists?

Added by jwjw yy over 6 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Code cleanup/refactoring
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

redmine/app/models/project.rb:671:      if versions.count > 0
redmine/app/views/imports/show.html.erb:3:<% if @import.saved_items.count > 0 %>
redmine/app/views/imports/show.html.erb:15:<% if @import.unsaved_items.count > 0 %>

could be

redmine/app/models/project.rb:671:      if versions.exists?
redmine/app/views/imports/show.html.erb:3:<% if @import.saved_items.exists? %>
redmine/app/views/imports/show.html.erb:15:<% if @import.unsaved_items.exists?%>

Related issues

Related to Redmine - Patch #24839: Minor performance improvement - Replace count by exists?ClosedJean-Philippe Lang

Actions
Actions

Also available in: Atom PDF