Skip to content

Commit 456dc86

Browse files
fix: satisfy sonarqube
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 85867b1 commit 456dc86

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/components/PeriodDimension/utils/enabledPeriodTypes.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ export const filterEnabledFixedPeriodTypes = (
5151
return []
5252
}
5353

54-
const enabledServerPtNames = enabledServerPeriodTypes.map((pt) => pt.name)
54+
const enabledServerPtNames = new Set(
55+
enabledServerPeriodTypes.map((pt) => pt.name)
56+
)
5557
const enabledMultiCalendarPts = new Set()
5658

5759
// Map server PT names to multi-calendar-dates constants
@@ -84,7 +86,9 @@ export const filterEnabledRelativePeriodTypes = (
8486
return []
8587
}
8688

87-
const enabledServerPtNames = enabledServerPeriodTypes.map((pt) => pt.name)
89+
const enabledServerPtNames = new Set(
90+
enabledServerPeriodTypes.map((pt) => pt.name)
91+
)
8892

8993
return allRelativePeriodOptions.filter((option) => {
9094
// Special handling for financial years
@@ -99,7 +103,7 @@ export const filterEnabledRelativePeriodTypes = (
99103
}
100104

101105
return requiredFpTypes.some((fpType) =>
102-
enabledServerPtNames.includes(fpType)
106+
enabledServerPtNames.has(fpType)
103107
)
104108
})
105109
}

0 commit comments

Comments
 (0)