mirror of
https://github.com/redmine/redmine.git
synced 2025-11-15 09:46:02 +01:00
Replace Hash#keys.each with faster Hash#each_key (#29305).
Patch by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@17458 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -582,7 +582,7 @@ class IssueQuery < Query
|
||||
end
|
||||
alias :find_author_id_filter_values :find_assigned_to_id_filter_values
|
||||
|
||||
IssueRelation::TYPES.keys.each do |relation_type|
|
||||
IssueRelation::TYPES.each_key do |relation_type|
|
||||
alias_method "sql_for_#{relation_type}_field".to_sym, :sql_for_relations
|
||||
end
|
||||
|
||||
|
||||
@@ -371,7 +371,7 @@ class Query < ActiveRecord::Base
|
||||
self.filters = {}
|
||||
add_filters(params[:fields] || params[:f], params[:operators] || params[:op], params[:values] || params[:v])
|
||||
else
|
||||
available_filters.keys.each do |field|
|
||||
available_filters.each_key do |field|
|
||||
add_short_filter(field, params[field]) if params[field]
|
||||
end
|
||||
end
|
||||
@@ -989,7 +989,7 @@ class Query < ActiveRecord::Base
|
||||
|
||||
def map_total(total, &block)
|
||||
if total.is_a?(Hash)
|
||||
total.keys.each {|k| total[k] = yield total[k]}
|
||||
total.each_key {|k| total[k] = yield total[k]}
|
||||
else
|
||||
total = yield total
|
||||
end
|
||||
|
||||
@@ -122,7 +122,7 @@ class UserPreference < ActiveRecord::Base
|
||||
# preferences.remove_block('news')
|
||||
def remove_block(block)
|
||||
block = block.to_s.underscore
|
||||
my_page_layout.keys.each do |group|
|
||||
my_page_layout.each_key do |group|
|
||||
my_page_layout[group].delete(block)
|
||||
end
|
||||
my_page_layout
|
||||
|
||||
@@ -61,7 +61,7 @@ module OpenIdAuthentication
|
||||
@code
|
||||
end
|
||||
|
||||
ERROR_MESSAGES.keys.each { |state| define_method("#{state}?") { @code == state } }
|
||||
ERROR_MESSAGES.each_key { |state| define_method("#{state}?") { @code == state } }
|
||||
|
||||
def successful?
|
||||
@code == :successful
|
||||
|
||||
@@ -608,7 +608,7 @@ module Redmine
|
||||
end
|
||||
end
|
||||
# Transforms dates into pixels witdh
|
||||
coords.keys.each do |key|
|
||||
coords.each_key do |key|
|
||||
coords[key] = (coords[key] * zoom).floor
|
||||
end
|
||||
coords
|
||||
|
||||
Reference in New Issue
Block a user