Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Уменьшаем алокацию объектов за счет замороженных строк #23

Merged
merged 1 commit into from
Feb 5, 2024

Conversation

hbda
Copy link
Contributor

@hbda hbda commented Feb 5, 2024

Основное здесь это globalize/model/active_record/postgres_array.rb. Там много используются строковые литералы внутри методов, а методы достаточно активно вызываются при взаимодействии с локализованными полями.

@@ -35,7 +36,7 @@ def lookup(locale, key, scope = [])
end

rails_dir = File.expand_path "#{File.dirname(__FILE__)}/../../../rails/"
paths = %w(actionpack/lib/action_view/locale/en-US.yml
paths = %w(actionpack/lib/action_view/locale/en-US.yml
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/PercentLiteralDelimiters: %w-literals should be delimited by [ and ]. (https://rubystyle.guide#percent-literal-braces)

@hbda hbda merged commit 6ce474a into master Feb 5, 2024
8 of 9 checks passed
@hbda hbda deleted the frozen_strings branch February 5, 2024 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants