Browse Source

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.
closed-social-glitch-2
Postmodern 2 years ago
committed by GitHub
parent
commit
106648b456
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      app/models/account_alias.rb

+ 1
- 1
app/models/account_alias.rb View File

@ -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…
Cancel
Save