compactify code

pull/3849/head
Rich Harris 5 years ago committed by GitHub
parent fb30ed079e
commit 15cc6f729a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -152,14 +152,8 @@ export default class Element extends Node {
}
// Binding relies on Attribute, defer its evaluation
const deferreds = ['Binding'];
info.attributes.sort((node1, node2) => {
const deferIndex1 = deferreds.indexOf(node1.type);
const deferIndex2 = deferreds.indexOf(node2.type);
return deferIndex1 - deferIndex2;
});
const order = ['Binding']; // everything else is -1
info.attributes.sort((a, b) => order.indexOf(a.type) - order.indexOf(b.type));
info.attributes.forEach(node => {
switch (node.type) {

Loading…
Cancel
Save