Skip to content

Commit

Permalink
modify the faster fetch alternate to match fetchShort
Browse files Browse the repository at this point in the history
  • Loading branch information
andrasq committed Feb 18, 2019
1 parent b668745 commit abb1cf0
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions mongoid.js
Expand Up @@ -175,11 +175,9 @@ MongoId.prototype.fetch = function fetch( ) {
// fetch sequenceId first, it waits if necessary
var sequenceId = this._getNextSequenceId();
/**
var lastTimestamp = this.hexTimestamp;
var timestamp = this._getTimestamp();
if (timestamp !== lastTimestamp) {
var sec = timestamp / 1000;
this.hexTimestamp = timestamp;
if (this._getTimestamp() !== this.hexTimestamp) {
this.hexTimestamp = this._getTimestamp();
var sec = this.hexTimestamp / 1000;
this.idPrefixHex =
_hexFormat8(sec) +
_hexFormat6(this.machineId) +
Expand Down

0 comments on commit abb1cf0

Please sign in to comment.