mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 16:06:16 -04:00
use Date.now() instead of new Date().getTime()
This is documented to be more performant. The substitution was made on frontend code, too (i.e., the one in /static), because Date.now() is supported since IE 9, and we are life supporting only IE 11. Commands: find . -name *.js | xargs sed --in-place "s/new Date().getTime()/Date.now()/g" find . -name *.js | xargs sed --in-place "s/(new Date()).getTime()/Date.now()/g" Not done on jQuery.
This commit is contained in:
parent
90bfbeb38d
commit
b34fc2de2b
13 changed files with 23 additions and 23 deletions
|
@ -110,7 +110,7 @@ function mapAuthorWithDBKey (mapperkey, mapper, callback)
|
|||
|
||||
//there is a author with this mapper
|
||||
//update the timestamp of this author
|
||||
db.setSub("globalAuthor:" + author, ["timestamp"], new Date().getTime());
|
||||
db.setSub("globalAuthor:" + author, ["timestamp"], Date.now());
|
||||
|
||||
//return the author
|
||||
callback(null, {authorID: author});
|
||||
|
@ -127,7 +127,7 @@ exports.createAuthor = function(name, callback)
|
|||
var author = "a." + randomString(16);
|
||||
|
||||
//create the globalAuthors db entry
|
||||
var authorObj = {"colorId" : Math.floor(Math.random()*(exports.getColorPalette().length)), "name": name, "timestamp": new Date().getTime()};
|
||||
var authorObj = {"colorId" : Math.floor(Math.random()*(exports.getColorPalette().length)), "name": name, "timestamp": Date.now()};
|
||||
|
||||
//set the global author db entry
|
||||
db.set("globalAuthor:" + author, authorObj);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue