Skip to content

Commit

Permalink
Merge pull request crossbario#13 from ExperiencePoint/master
Browse files Browse the repository at this point in the history
Faster newid generation
  • Loading branch information
Tobias Oberstein committed Mar 6, 2013
2 parents e7443ae + e90146a commit c271772
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion autobahn/autobahn.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@ ab._newid = function () {
return id;
};

ab._newidFast = function () {
return Math.random().toString(36);
}

ab.log = function () {
if (window.console && console.log) {
//console.log.apply(console, !!arguments.length ? arguments : [this]);
Expand Down Expand Up @@ -666,7 +670,7 @@ ab.Session.prototype.call = function () {
var d = new ab._Deferred();
var callid;
while (true) {
callid = ab._newid();
callid = ab._newidFast();
if (!(callid in self._calls)) {
break;
}
Expand Down

0 comments on commit c271772

Please sign in to comment.