Improvements to STParsedJSON:

* Cleanups and reduction of copying
* Add STArray::back, operator[], push_back(&&)
* Add make_stvar
* Rework STParsedJSON
* Fix code and unit tests that use STParsedJSON
* STTx move constructor
This commit is contained in:
JoelKatz
2015-04-23 10:32:51 -07:00
committed by Nik Bougalis
parent 5a7fa8cfa9
commit 4244e1070d
13 changed files with 152 additions and 132 deletions

View File

@@ -445,15 +445,14 @@ transactionSign (
}
STParsedJSONObject parsed (std::string (jss::tx_json), tx_json);
if (!parsed.object.get())
if (! parsed.object)
{
jvResult [jss::error] = parsed.error [jss::error];
jvResult [jss::error_code] = parsed.error [jss::error_code];
jvResult [jss::error_message] = parsed.error [jss::error_message];
return jvResult;
}
std::unique_ptr<STObject> sopTrans = std::move(parsed.object);
sopTrans->setFieldVL (
parsed.object->setFieldVL (
sfSigningPubKey,
keypair.publicKey.getAccountPublic());
@@ -461,7 +460,7 @@ transactionSign (
try
{
stpTrans = std::make_shared<STTx> (*sopTrans);
stpTrans = std::make_shared<STTx> (std::move (*parsed.object));
}
catch (std::exception&)
{