Skip to content
Snippets Groups Projects
Unverified Commit 106648b4 authored by Postmodern's avatar Postmodern Committed by GitHub
Browse files

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.
parent 86a80acf
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment