Skip to content
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

refactor: small syntax changes #137

Merged
merged 2 commits into from
Feb 5, 2018
Merged

refactor: small syntax changes #137

merged 2 commits into from
Feb 5, 2018

Conversation

saschanaz
Copy link
Member

@saschanaz saschanaz commented Feb 4, 2018

Keywords can be used as property names in ES5 so this PR removes quotes for them.

Originally I intended to use array.join() for string concatenation in writer.js and then found that it's actually slower on V8. Hmm.

 function iterate(things) {
   if (!things) return;
-  let ret = "";
-  for (const thing of things) ret += dispatch(thing);
-  return ret;
+  return things.map(dispatch).join('');
 };

@saschanaz saschanaz merged commit ba00d5d into develop Feb 5, 2018
@saschanaz saschanaz deleted the refactor branch February 5, 2018 01:55
@marcoscaceres
Copy link
Member

Worth doing a release or should we sit on this for a bit?

@saschanaz
Copy link
Member Author

This doesn't boost performance or add any features, so we should sit on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants