Skip to content

Commit

Permalink
(issue 12) Not reusing last fake id to prevent collisions.
Browse files Browse the repository at this point in the history
  • Loading branch information
turuslan committed Jan 18, 2016
1 parent 8e2fef9 commit 9d0bf4d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions HackTimer.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ onmessage = function (event) {\
logPrefix = 'HackTimer.js by turuslan: ';
if (typeof (Worker) !== 'undefined') {
function getFakeId () {
while (fakeIdToCallback.hasOwnProperty (lastFakeId)) {
do {
if (lastFakeId == maxFakeId) {
lastFakeId = 0;
} else {
lastFakeId ++;
}
}
} while (fakeIdToCallback.hasOwnProperty (lastFakeId));
return lastFakeId;
}
try {
Expand Down
2 changes: 1 addition & 1 deletion HackTimer.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion HackTimer.silent.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9d0bf4d

Please sign in to comment.