Skip to content

Commit 93b29e1

Browse files
committed
remove a couple more unnecessary assertions
1 parent d114f81 commit 93b29e1

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

packages/toolkit/src/entities/sorted_state_adapter.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,7 @@ export function createSortedStateAdapter<T, Id extends EntityId>(
6969
): void {
7070
newEntities = ensureEntitiesArray(newEntities)
7171

72-
const existingKeys = new Set<Id>(
73-
existingIds ?? (getCurrent(state.ids) as Id[]),
74-
)
72+
const existingKeys = new Set<Id>(existingIds ?? getCurrent(state.ids))
7573

7674
const models = newEntities.filter(
7775
(model) => !existingKeys.has(selectIdValue(model, selectId)),
@@ -197,8 +195,8 @@ export function createSortedStateAdapter<T, Id extends EntityId>(
197195
appliedUpdates,
198196
replacedIds,
199197
) => {
200-
const currentEntities = getCurrent(state.entities) as Record<Id, T>
201-
const currentIds = getCurrent(state.ids) as Id[]
198+
const currentEntities = getCurrent(state.entities)
199+
const currentIds = getCurrent(state.ids)
202200

203201
const stateEntities = state.entities as Record<Id, T>
204202

0 commit comments

Comments
 (0)