From 31e9a8384a77947f6777d035992f4734618ed206 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Thu, 21 Aug 2014 00:49:32 +0200 Subject: Use CSizeComputer to avoid counting sizes in SerializationOp --- src/qt/recentrequeststablemodel.h | 9 +++------ src/qt/walletmodel.h | 7 ++----- 2 files changed, 5 insertions(+), 11 deletions(-) (limited to 'src/qt') diff --git a/src/qt/recentrequeststablemodel.h b/src/qt/recentrequeststablemodel.h index 581d7b2c5e..a558aa4942 100644 --- a/src/qt/recentrequeststablemodel.h +++ b/src/qt/recentrequeststablemodel.h @@ -27,9 +27,8 @@ public: IMPLEMENT_SERIALIZE; template - inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - size_t nSerSize = 0; - bool fRead = boost::is_same(); + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { + bool fRead = ser_action.ForRead(); RecentRequestEntry* pthis = const_cast(this); @@ -42,9 +41,7 @@ public: READWRITE(recipient); if (fRead) - pthis->date = QDateTime::fromTime_t(nDate); - - return nSerSize; + date = QDateTime::fromTime_t(nDate); } }; diff --git a/src/qt/walletmodel.h b/src/qt/walletmodel.h index 553b566544..2a9ac4650f 100644 --- a/src/qt/walletmodel.h +++ b/src/qt/walletmodel.h @@ -62,9 +62,8 @@ public: IMPLEMENT_SERIALIZE; template - inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - size_t nSerSize = 0; - bool fRead = boost::is_same(); + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { + bool fRead = ser_action.ForRead(); SendCoinsRecipient* pthis = const_cast(this); @@ -94,8 +93,6 @@ public: pthis->paymentRequest.parse(QByteArray::fromRawData(sPaymentRequest.data(), sPaymentRequest.size())); pthis->authenticatedMerchant = QString::fromStdString(sAuthenticatedMerchant); } - - return nSerSize; } }; -- cgit v1.2.3