Skip to content

Commit

Permalink
Clean up regexp
Browse files Browse the repository at this point in the history
  • Loading branch information
ai committed Dec 14, 2019
1 parent d3e9e67 commit 1c6dca5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion test/alphabet-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function tick () {
steps += 1
let alphabet = getAlphabet(positions)
if (alphabet) {
let file = workerData.js.replace(/[A-Za-z0-9-_]{30,}/, alphabet)
let file = workerData.js.replace(/[\w-]{30,}/, alphabet)
gzipSize(file).then(size => {
parentPort.postMessage({ alphabet, steps, size })
steps = 0
Expand Down
4 changes: 2 additions & 2 deletions test/demo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ const LENGTH = ALPHABET.length

function print (number) {
return String(Math.floor(number * 100))
.replace(/\d\d\d\d\d\d$/, ',$&')
.replace(/\d\d\d$/, ',$&')
.replace(/\d{6}$/, ',$&')
.replace(/\d{3}$/, ',$&')
}

function printDistr (title, fn) {
Expand Down

0 comments on commit 1c6dca5

Please sign in to comment.