Skip to content

Commit

Permalink
remove a couple more unnecessary assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
EskiMojo14 committed Jun 28, 2024
1 parent d114f81 commit 93b29e1
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/toolkit/src/entities/sorted_state_adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,7 @@ export function createSortedStateAdapter<T, Id extends EntityId>(
): void {
newEntities = ensureEntitiesArray(newEntities)

const existingKeys = new Set<Id>(
existingIds ?? (getCurrent(state.ids) as Id[]),
)
const existingKeys = new Set<Id>(existingIds ?? getCurrent(state.ids))

const models = newEntities.filter(
(model) => !existingKeys.has(selectIdValue(model, selectId)),
Expand Down Expand Up @@ -197,8 +195,8 @@ export function createSortedStateAdapter<T, Id extends EntityId>(
appliedUpdates,
replacedIds,
) => {
const currentEntities = getCurrent(state.entities) as Record<Id, T>
const currentIds = getCurrent(state.ids) as Id[]
const currentEntities = getCurrent(state.entities)
const currentIds = getCurrent(state.ids)

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

Expand Down

0 comments on commit 93b29e1

Please sign in to comment.