From 106648b456396cd7b433848dd6608537d5b811f4 Mon Sep 17 00:00:00 2001 From: Postmodern Date: Mon, 7 Nov 2022 07:17:55 -0800 Subject: [PATCH] Micro-optimization: only split `acct` into two Strings (#19901) * Since `acct` is split by `@` and assigned to `username` and `domain`, we only need to split `acct` into two Strings. --- app/models/account_alias.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/account_alias.rb b/app/models/account_alias.rb index b421c66e2..b7267d632 100644 --- a/app/models/account_alias.rb +++ b/app/models/account_alias.rb @@ -29,7 +29,7 @@ class AccountAlias < ApplicationRecord end def pretty_acct - username, domain = acct.split('@') + username, domain = acct.split('@', 2) domain.nil? ? username : "#{username}@#{Addressable::IDNA.to_unicode(domain)}" end