summaryrefslogtreecommitdiff
path: root/src/mongo/bson/bsonelement.h
diff options
context:
space:
mode:
authorEric Milkie <milkie@10gen.com>2015-04-09 08:02:20 -0400
committerEric Milkie <milkie@10gen.com>2015-04-09 08:02:20 -0400
commit48f14493a3751483b67144897a44ed3297720f8c (patch)
tree596e6a9a7993de99622cd8d17cbc549a5a217704 /src/mongo/bson/bsonelement.h
parent04a120d6dc50d6bb1fd5073ea28a6c8ddc07fecd (diff)
downloadmongo-48f14493a3751483b67144897a44ed3297720f8c.tar.gz
Revert "SERVER-15047 Remove undefined behavior from Timestamp"
This reverts commit e87716a9286b6aa6f63a513012e55f6e42f634a2.
Diffstat (limited to 'src/mongo/bson/bsonelement.h')
-rw-r--r--src/mongo/bson/bsonelement.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/mongo/bson/bsonelement.h b/src/mongo/bson/bsonelement.h
index a5919d7f6d7..cc5c687f8d7 100644
--- a/src/mongo/bson/bsonelement.h
+++ b/src/mongo/bson/bsonelement.h
@@ -454,10 +454,9 @@ namespace mongo {
}
Timestamp timestamp() const {
- Timestamp result;
if( type() == mongo::Date || type() == bsonTimestamp )
- result.readFrom(value());
- return result;
+ return Timestamp(ConstDataView(value()).readLE<unsigned long long>());
+ return Timestamp();
}
Date_t timestampTime() const {