Prefer Contains() over find() != npos

This commit is contained in:
J-P Nurmi
2015-08-14 12:46:51 +02:00
parent 6a6fbab342
commit 2417ca68a8
6 changed files with 13 additions and 13 deletions

View File

@@ -495,7 +495,7 @@ bool CModule::AddCommand(const CModCommand& Command)
{
if (Command.GetFunction() == nullptr)
return false;
if (Command.GetCommand().find(' ') != CString::npos)
if (Command.GetCommand().Contains(" "))
return false;
if (FindCommand(Command.GetCommand()) != nullptr)
return false;
@@ -1226,7 +1226,7 @@ bool CModules::FindModPath(const CString& sModule, CString& sModPath,
CString& sDataPath) {
CString sMod = sModule;
CString sDir = sMod;
if (sModule.find(".") == CString::npos)
if (!sModule.Contains("."))
sMod += ".so";
ModDirList dirs = GetModDirs();