Browse Source

Add comment explaining behavior

pull/533/head
Joe4evr 8 years ago
parent
commit
b28fd87e26
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      src/Discord.Net.Commands/CommandService.cs

+ 2
- 0
src/Discord.Net.Commands/CommandService.cs View File

@@ -228,6 +228,8 @@ namespace Discord.Commands
public SearchResult Search(ICommandContext context, string input) public SearchResult Search(ICommandContext context, string input)
{ {
string searchInput = _caseSensitive ? input : input.ToLowerInvariant(); string searchInput = _caseSensitive ? input : input.ToLowerInvariant();

// We sort by Ascending priority here because the collection is looped over backwards later.
var matches = _map.GetCommands(searchInput).OrderBy(x => x.Command.Priority).ToImmutableArray(); var matches = _map.GetCommands(searchInput).OrderBy(x => x.Command.Priority).ToImmutableArray();


if (matches.Length > 0) if (matches.Length > 0)


Loading…
Cancel
Save