mirror of
https://framagit.org/tykayn/mastodon.git
synced 2023-08-25 08:33:12 +02:00
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.
This commit is contained in:
parent
86a80acf40
commit
106648b456
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user