mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 09:31:45 +00:00
Apply clang-tidy suggestions [performance-faster-string-find]
This commit is contained in:
committed by
Dennis Klein
parent
4951433330
commit
c40bd7d6a9
@@ -143,15 +143,15 @@ string FairMQChannel::GetChannelName() const
|
||||
string FairMQChannel::GetChannelPrefix() const
|
||||
{
|
||||
string prefix = fName;
|
||||
prefix = prefix.erase(fName.rfind("["));
|
||||
prefix = prefix.erase(fName.rfind('['));
|
||||
return prefix;
|
||||
}
|
||||
|
||||
string FairMQChannel::GetChannelIndex() const
|
||||
{
|
||||
string indexStr = fName;
|
||||
indexStr.erase(indexStr.rfind("]"));
|
||||
indexStr.erase(0, indexStr.rfind("[") + 1);
|
||||
indexStr.erase(indexStr.rfind(']'));
|
||||
indexStr.erase(0, indexStr.rfind('[') + 1);
|
||||
return indexStr;
|
||||
}
|
||||
|
||||
@@ -564,7 +564,7 @@ bool FairMQChannel::ValidateChannel()
|
||||
{
|
||||
// check if TCP address contains port delimiter
|
||||
string addressString = address.substr(6);
|
||||
if (addressString.find(":") == string::npos)
|
||||
if (addressString.find(':') == string::npos)
|
||||
{
|
||||
ss << "INVALID";
|
||||
LOG(debug) << ss.str();
|
||||
|
Reference in New Issue
Block a user