Disallow redundant typecasts. (#15030)

This commit is contained in:
Christian Gunderman
2025-12-12 17:43:43 -08:00
committed by GitHub
parent fcc3b2b5ec
commit 942bcfc61e
86 changed files with 235 additions and 371 deletions
@@ -106,7 +106,7 @@ const computeInitialIndex = (
if (initialKey !== undefined) {
for (let i = 0; i < items.length; i++) {
if (items[i]!.key === initialKey && !items[i]!.disabled) {
if (items[i].key === initialKey && !items[i].disabled) {
return i;
}
}
@@ -212,7 +212,7 @@ function areBaseItemsEqual(
if (a.length !== b.length) return false;
for (let i = 0; i < a.length; i++) {
if (a[i]!.key !== b[i]!.key || a[i]!.disabled !== b[i]!.disabled) {
if (a[i].key !== b[i].key || a[i].disabled !== b[i].disabled) {
return false;
}
}
@@ -283,7 +283,7 @@ export function useSelectionList<T>({
let needsClear = false;
if (state.pendingHighlight && items[state.activeIndex]) {
onHighlight?.(items[state.activeIndex]!.value);
onHighlight?.(items[state.activeIndex].value);
needsClear = true;
}