mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-24 04:55:52 +00:00
Make some boost::format objects static.
This commit is contained in:
@@ -146,12 +146,13 @@ bool Transaction::save()
|
|||||||
default: status = TXN_SQL_UNKNOWN;
|
default: status = TXN_SQL_UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string exists = boost::str(boost::format("SELECT Status FROM Transactions WHERE TransID = '%s';")
|
static boost::format selStat("SELECT Status FROM Transactions WHERE TransID = '%s';");
|
||||||
% mTransaction->getTransactionID().GetHex());
|
std::string exists = boost::str(selStat % mTransaction->getTransactionID().GetHex());
|
||||||
|
|
||||||
Database *db = theApp->getTxnDB()->getDB();
|
Database *db = theApp->getTxnDB()->getDB();
|
||||||
ScopedLock dbLock(theApp->getTxnDB()->getDBLock());
|
ScopedLock dbLock(theApp->getTxnDB()->getDBLock());
|
||||||
if (SQL_EXISTS(db, exists)) return false;
|
if (SQL_EXISTS(db, exists))
|
||||||
|
return false;
|
||||||
return
|
return
|
||||||
db->executeSQL(mTransaction->getSQLInsertHeader() + mTransaction->getSQL(getLedger(), status) + ";");
|
db->executeSQL(mTransaction->getSQLInsertHeader() + mTransaction->getSQL(getLedger(), status) + ";");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -154,7 +154,8 @@ inline std::string strHex(const uint64 uiHost)
|
|||||||
|
|
||||||
inline static std::string sqlEscape(const std::string& strSrc)
|
inline static std::string sqlEscape(const std::string& strSrc)
|
||||||
{
|
{
|
||||||
return str(boost::format("X'%s'") % strHex(strSrc));
|
static boost::format f("X'%s'");
|
||||||
|
return str(f % strHex(strSrc));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class Iterator>
|
template<class Iterator>
|
||||||
|
|||||||
Reference in New Issue
Block a user