Skip to content

refactor: small syntax changes - #137

Merged
saschanaz merged 2 commits into
developfrom
refactor
Feb 5, 2018
Merged

refactor: small syntax changes#137
saschanaz merged 2 commits into
developfrom
refactor

Conversation

@saschanaz

@saschanaz saschanaz commented Feb 4, 2018

Copy link
Copy Markdown
Member

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
Copy Markdown
Member

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

@saschanaz

Copy link
Copy Markdown
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.

2 participants