summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2010-03-06 08:45:12 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2010-03-06 08:45:12 +0000
commit61b2b88c29accbc5a4b04471abbd5cc7e38c4baf (patch)
treeb1ee18382bcf2ad569ea6f01ed6e1348ac7aaa7f
parent8d09b069e2b709d8657f5fdbcf2a933515545f39 (diff)
2010-03-06 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Rewritten copy ctor of RequestSlot to use initialization list. * src/RequestSlot.h
-rw-r--r--ChangeLog5
-rw-r--r--src/RequestSlot.h13
2 files changed, 13 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 3d2f274d..008b32e2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
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>
+
Added Time global::wallclock to cache "current time" to reduce the
call gettimeofday(). Global variables are now in namespace global.
* src/AbstractCommand.cc
diff --git a/src/RequestSlot.h b/src/RequestSlot.h
index 7adc3202..372b4641 100644
--- a/src/RequestSlot.h
+++ b/src/RequestSlot.h
@@ -59,11 +59,11 @@ private:
// inlined for performance reason
void copy(const RequestSlot& requestSlot)
{
+ dispatchedTime = requestSlot.dispatchedTime;
index = requestSlot.index;
begin = requestSlot.begin;
length = requestSlot.length;
blockIndex = requestSlot.blockIndex;
- dispatchedTime = requestSlot.dispatchedTime;
_piece = requestSlot._piece;
}
public:
@@ -73,10 +73,13 @@ public:
index(index), begin(begin), length(length), blockIndex(blockIndex),
_piece(piece) {}
- RequestSlot(const RequestSlot& requestSlot)
- {
- copy(requestSlot);
- }
+ RequestSlot(const RequestSlot& requestSlot):
+ dispatchedTime(requestSlot.dispatchedTime),
+ index(requestSlot.index),
+ begin(requestSlot.begin),
+ length(requestSlot.length),
+ blockIndex(requestSlot.blockIndex),
+ _piece(requestSlot._piece) {}
RequestSlot():index(0), begin(0), length(0), blockIndex(0) {}