Avoid repeated strtolower usages in a couple of places

This commit is contained in:
Dylan K. Taylor
2022-09-28 21:30:06 +01:00
parent d6bbf8217d
commit 0c7f8470b9
2 changed files with 6 additions and 4 deletions

View File

@ -272,10 +272,11 @@ class SimpleCommandMap implements CommandMap{
}
//These registered commands have absolute priority
$lowerAlias = strtolower($alias);
if(count($targets) > 0){
$this->knownCommands[strtolower($alias)] = new FormattedCommandAlias(strtolower($alias), $targets);
$this->knownCommands[$lowerAlias] = new FormattedCommandAlias($lowerAlias, $targets);
}else{
unset($this->knownCommands[strtolower($alias)]);
unset($this->knownCommands[$lowerAlias]);
}
}