Skip to content

Commit

Permalink
refactor(aria.js): simplify "globalSP to HTML"
Browse files Browse the repository at this point in the history
Simplifies second (and last) use of "sortedList" by
a) realizing that globalSP is already sorted since the spec is.
b) iterating over globalSP's values

test.sh run is clean.
  • Loading branch information
pkra committed Nov 28, 2023
1 parent fe4ccca commit 4ae0030
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions script/aria.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ function ariaAttributeReferences() {
// we have all the properties and states - spit out the
// index
let propIndex = "";
let sortedList = [];

for (let item of Object.values(propList)) {
propIndex +=
Expand All @@ -110,11 +109,7 @@ function ariaAttributeReferences() {
parentNode.replaceChild(l, node);

let globalSPIndex = "";
sortedList = globalSP.sort(function (a, b) {
return a.name < b.name ? -1 : a.name > b.name ? 1 : 0;
});
for (i = 0; i < sortedList.length; i++) {
const lItem = sortedList[i];
for (let lItem of globalSP) {
globalSPIndex += "<li>";
if (lItem.is === "state") {
globalSPIndex +=
Expand Down

0 comments on commit 4ae0030

Please sign in to comment.