Skip to content

Create _benchmarks/32141341234123412341234-vs-12341234124314232141234234.md #326

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
title: 32141341234123412341234 vs 12341234124314232141234234
setup: |
var str = 'asdf asdf sdf asdf asdf';
tests:
-
name: 32141341234123412341234
code: |
var wasSpace = false;
var f = '';
for (let x = 0, len = str.length; x < len; x++) {
let chr = str[x];
if (chr === ' ') {
if (wasSpace) continue;
wasSpace = true;
}else {
wasSpace = false;
}
f += chr;
}
-
name: 12341234124314232141234234
code: |
str.replace(/\s+/g, ' ');
---