diff --git a/src/mongo/bson/oid.cpp b/src/mongo/bson/oid.cpp index 2c726cd96d7..e72f7a3811d 100644 --- a/src/mongo/bson/oid.cpp +++ b/src/mongo/bson/oid.cpp @@ -157,7 +157,7 @@ namespace { kInstanceUniqueSize + kIncrementSize); } - time_t OID::asTimeT() { + time_t OID::asTimeT() const { return getTimestamp(); } diff --git a/src/mongo/bson/oid.h b/src/mongo/bson/oid.h index a8a3e494124..df29065bb5e 100644 --- a/src/mongo/bson/oid.h +++ b/src/mongo/bson/oid.h @@ -139,8 +139,8 @@ namespace mongo { /** Set to the min/max OID that could be generated at given timestamp. */ void init( Date_t date, bool max=false ); - time_t asTimeT(); - Date_t asDateT() { return asTimeT() * 1000LL; } + time_t asTimeT() const; + Date_t asDateT() const { return asTimeT() * 1000LL; } // True iff the OID is not empty bool isSet() const {