Skip to content
This repository has been archived by the owner on Apr 6, 2021. It is now read-only.

Commit

Permalink
Improved the fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruben Daniels committed Jun 27, 2013
1 parent 64b1977 commit 63e9bc8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion consumer.js
Expand Up @@ -128,7 +128,7 @@ function Consumer() {
var nextStreamID = 1;
function storeStream(stream) {
nextStreamID = nextStreamID++ % 10000;
while (streams.hasOwnProperty(nextStreamID)) { nextStreamID++; }
while (streams.hasOwnProperty(nextStreamID)) { nextStreamID++ % 10000; }
var id = nextStreamID;
streams[id] = stream;
stream.id = id;
Expand Down
2 changes: 1 addition & 1 deletion worker.js
Expand Up @@ -153,7 +153,7 @@ function Worker(vfs) {
var nextStreamID = 1;
function storeStream(stream) {
nextStreamID = nextStreamID++ % 10000;
while (streams.hasOwnProperty(nextStreamID)) { nextStreamID++; }
while (streams.hasOwnProperty(nextStreamID)) { nextStreamID++ % 10000; }
var id = nextStreamID;
streams[id] = stream;
stream.id = id;
Expand Down

0 comments on commit 63e9bc8

Please sign in to comment.