about summary refs log tree commit diff
path: root/app/models/account_alias.rb
diff options
context:
space:
mode:
authorPostmodern <postmodern.mod3@gmail.com>2022-11-07 07:17:55 -0800
committerGitHub <noreply@github.com>2022-11-07 16:17:55 +0100
commit106648b456396cd7b433848dd6608537d5b811f4 (patch)
treee0eeb873aed3763c8caa2971c6b3c9f73f952fc9 /app/models/account_alias.rb
parent86a80acf40c5ca212ffede62a42806e035d7cab3 (diff)
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.
Diffstat (limited to 'app/models/account_alias.rb')
-rw-r--r--app/models/account_alias.rb2
1 files changed, 1 insertions, 1 deletions
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