mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-18 13:17:55 +02:00
Remove redundant .c_str()s
After the tinyformat switch sprintf() family functions support passing actual std::string objects. Remove unnecessary c_str calls (236 of them) in logging and formatting.
This commit is contained in:
parent
b77dfdc9e3
commit
7d9d134bf9
22 changed files with 236 additions and 236 deletions
|
|
@ -67,7 +67,7 @@ bool CMessageHeader::IsValid() const
|
|||
// Message size
|
||||
if (nMessageSize > MAX_SIZE)
|
||||
{
|
||||
LogPrintf("CMessageHeader::IsValid() : (%s, %u bytes) nMessageSize > MAX_SIZE\n", GetCommand().c_str(), nMessageSize);
|
||||
LogPrintf("CMessageHeader::IsValid() : (%s, %u bytes) nMessageSize > MAX_SIZE\n", GetCommand(), nMessageSize);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -118,7 +118,7 @@ CInv::CInv(const std::string& strType, const uint256& hashIn)
|
|||
}
|
||||
}
|
||||
if (i == ARRAYLEN(ppszTypeName))
|
||||
throw std::out_of_range(strprintf("CInv::CInv(string, uint256) : unknown type '%s'", strType.c_str()));
|
||||
throw std::out_of_range(strprintf("CInv::CInv(string, uint256) : unknown type '%s'", strType));
|
||||
hash = hashIn;
|
||||
}
|
||||
|
||||
|
|
@ -141,11 +141,11 @@ const char* CInv::GetCommand() const
|
|||
|
||||
std::string CInv::ToString() const
|
||||
{
|
||||
return strprintf("%s %s", GetCommand(), hash.ToString().c_str());
|
||||
return strprintf("%s %s", GetCommand(), hash.ToString());
|
||||
}
|
||||
|
||||
void CInv::print() const
|
||||
{
|
||||
LogPrintf("CInv(%s)\n", ToString().c_str());
|
||||
LogPrintf("CInv(%s)\n", ToString());
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue