wallet: refactor: avoid duplicate lookup on mapValue["timesmart"]

Also, use a named cast for converting the atoi64() result into an
unsigned int type.
This commit is contained in:
Sebastian Falbesoner committed 2021-09-12 23:41:32 +02:00
1 parent 973d8ba93d
commit 98cf19ca32
1 file changed
+2 -1
+2 -1
View File
@@ -217,7 +217,8 @@ public:
const auto it_op = mapValue.find("n");
nOrderPos = (it_op != mapValue.end()) ? atoi64(it_op->second) : -1;
nTimeSmart = mapValue.count("timesmart") ? (unsigned int)atoi64(mapValue["timesmart"]) : 0;
const auto it_ts = mapValue.find("timesmart");
nTimeSmart = (it_ts != mapValue.end()) ? static_cast<unsigned int>(atoi64(it_ts->second)) : 0;
mapValue.erase("fromaccount");
mapValue.erase("spent");