mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 02:48:28 +08:00
Merge pull request #3385 from tancnle/each-key-refactor
Replace Hash#keys.each with Hash#each_key for some perf boost
This commit is contained in:
@ -436,7 +436,7 @@ class PostsController < ApplicationController
|
||||
result[:is_warning] = false
|
||||
end
|
||||
|
||||
PostRevisor.tracked_topic_fields.keys.each do |f|
|
||||
PostRevisor.tracked_topic_fields.each_key do |f|
|
||||
params.permit(f => [])
|
||||
result[f] = params[f] if params.has_key?(f)
|
||||
end
|
||||
|
@ -128,7 +128,7 @@ class TopicsController < ApplicationController
|
||||
guardian.ensure_can_edit!(topic)
|
||||
|
||||
changes = {}
|
||||
PostRevisor.tracked_topic_fields.keys.each do |f|
|
||||
PostRevisor.tracked_topic_fields.each_key do |f|
|
||||
changes[f] = params[f] if params.has_key?(f)
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user