Light optimizations

This commit is contained in:
Kawe Mazidjatari 2022-06-07 13:46:09 +02:00
parent 872b39514f
commit 326b751934
2 changed files with 5 additions and 5 deletions

View File

@ -129,14 +129,14 @@ void ParseAndApplyConfigFile(const string& svConfig)
{
while (std::getline(ss, svInput, '\n'))
{
size_t nPos = svInput.find(" ");
string::size_type nPos = svInput.find(' ');
if (!svInput.empty()
&& nPos > 0
&& nPos < svInput.size()
&& nPos != svInput.size())
{
string svValue = svInput.substr(nPos + 1);
string svArgument = svInput.erase(svInput.find(" "));
string svArgument = svInput.erase(svInput.find(' '));
CommandLine()->AppendParm(svArgument.c_str(), svValue.c_str());
}

View File

@ -113,7 +113,7 @@ void CNetCon::UserInput(void)
this->Disconnect();
return;
}
size_t nPos = svInput.find(" ");
string::size_type nPos = svInput.find(' ');
if (!svInput.empty()
&& nPos > 0
&& nPos < svInput.size()
@ -147,14 +147,14 @@ void CNetCon::UserInput(void)
}
else // Setup connection from input.
{
size_t nPos = svInput.find(" ");
string::size_type nPos = svInput.find(' ');
if (!svInput.empty()
&& nPos > 0
&& nPos < svInput.size()
&& nPos != svInput.size())
{
std::string svInPort = svInput.substr(nPos + 1);
std::string svInAdr = svInput.erase(svInput.find(" "));
std::string svInAdr = svInput.erase(svInput.find(' '));
if (!this->Connect(svInAdr, svInPort))
{