Skip to content

Commit

Permalink
Use new array feature instead of for loop to zero
Browse files Browse the repository at this point in the history
  • Loading branch information
download13 committed Aug 14, 2018
1 parent b0890d0 commit 65f336d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/blockies.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
const randseed = new Array(4); // Xorshift: [x, y, z, w] 32 bit values

function seedrand(seed) {
for(let i = 0; i < randseed.length; i++) {
randseed[i] = 0;
}
randseed.fill(0);

for(let i = 0; i < seed.length; i++) {
randseed[i%4] = ((randseed[i%4] << 5) - randseed[i%4]) + seed.charCodeAt(i);
}
Expand Down

0 comments on commit 65f336d

Please sign in to comment.