Skip to content

Commit

Permalink
refactored for loop to use forEach()
Browse files Browse the repository at this point in the history
  • Loading branch information
BboyAkers committed Nov 20, 2024
1 parent a51fdfd commit e80e974
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/components/shared/DataTableHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@ const DataTableHeader = ({ headerGroups, onSortedChange, sorted, showFilter, dyn

const isIndexedAttribute = (columnId) => {
let isIndexed = false;
for (let i = 0; i < tableDescriptionAttributes.length; i++) {
const attr = tableDescriptionAttributes[i];
tableDescriptionAttributes.forEach((attr) => {
if (attr.attribute === columnId && (attr.is_primary_key || attr.indexed)) {
isIndexed = true;
break;
}
}
});
return isIndexed;
}

Expand Down

0 comments on commit e80e974

Please sign in to comment.