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
							
								
									3f108bf80b
								
							
						
					
					
						commit
						41d43a1e1f
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
					@ -29,7 +29,7 @@ class AccountAlias < ApplicationRecord
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def pretty_acct
 | 
					  def pretty_acct
 | 
				
			||||||
    username, domain = acct.split('@')
 | 
					    username, domain = acct.split('@', 2)
 | 
				
			||||||
    domain.nil? ? username : "#{username}@#{Addressable::IDNA.to_unicode(domain)}"
 | 
					    domain.nil? ? username : "#{username}@#{Addressable::IDNA.to_unicode(domain)}"
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue