Rubocop fix: Perfomance/UnfreezeString (#26217)
This commit is contained in:
1 parent
4d1b67f664
commit
30f5ec7303
6 files changed
+33
-18
No files matched your search
@@ -45,7 +45,7 @@ class StatusLengthValidator < ActiveModel::Validator
|
||||
|
||||
def rewrite_entities(str, entities)
|
||||
entities.sort_by! { |entity| entity[:indices].first }
|
||||
result = ''.dup
|
||||
result = +''
|
||||
|
||||
last_index = entities.reduce(0) do |index, entity|
|
||||
result << str[index...entity[:indices].first]
|
||||
|
||||
Reference in new issue
Block a user