mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 01:31:35 +08:00
PERF: Try to match users before groups.
User mentions are more common than group mentions so this will allow us to avoid an extra query.
This commit is contained in:
@ -41,8 +41,8 @@ module PrettyText
|
||||
|
||||
def mention_lookup(name)
|
||||
return false if name.blank?
|
||||
return "group" if Group.exists?(name: name)
|
||||
return "user" if User.exists?(username_lower: name.downcase)
|
||||
return "group" if Group.exists?(name: name)
|
||||
end
|
||||
|
||||
def category_hashtag_lookup(category_slug)
|
||||
|
Reference in New Issue
Block a user