2010-03-06 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

Rewritten copy ctor of RequestSlot to use initialization list.
	* src/RequestSlot.h
pull/1/head
Tatsuhiro Tsujikawa 2010-03-06 08:45:12 +00:00
parent 8d09b069e2
commit 61b2b88c29
2 changed files with 13 additions and 5 deletions

View File

@ -1,3 +1,8 @@
2010-03-06 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Rewritten copy ctor of RequestSlot to use initialization list.
* src/RequestSlot.h
2010-03-06 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net> 2010-03-06 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added Time global::wallclock to cache "current time" to reduce the Added Time global::wallclock to cache "current time" to reduce the

View File

@ -59,11 +59,11 @@ private:
// inlined for performance reason // inlined for performance reason
void copy(const RequestSlot& requestSlot) void copy(const RequestSlot& requestSlot)
{ {
dispatchedTime = requestSlot.dispatchedTime;
index = requestSlot.index; index = requestSlot.index;
begin = requestSlot.begin; begin = requestSlot.begin;
length = requestSlot.length; length = requestSlot.length;
blockIndex = requestSlot.blockIndex; blockIndex = requestSlot.blockIndex;
dispatchedTime = requestSlot.dispatchedTime;
_piece = requestSlot._piece; _piece = requestSlot._piece;
} }
public: public:
@ -73,10 +73,13 @@ public:
index(index), begin(begin), length(length), blockIndex(blockIndex), index(index), begin(begin), length(length), blockIndex(blockIndex),
_piece(piece) {} _piece(piece) {}
RequestSlot(const RequestSlot& requestSlot) RequestSlot(const RequestSlot& requestSlot):
{ dispatchedTime(requestSlot.dispatchedTime),
copy(requestSlot); index(requestSlot.index),
} begin(requestSlot.begin),
length(requestSlot.length),
blockIndex(requestSlot.blockIndex),
_piece(requestSlot._piece) {}
RequestSlot():index(0), begin(0), length(0), blockIndex(0) {} RequestSlot():index(0), begin(0), length(0), blockIndex(0) {}