Skip to content

Commit

Permalink
Remove commented code in SparseSet
Browse files Browse the repository at this point in the history
  • Loading branch information
sondresj committed Oct 9, 2021
1 parent b06397f commit dcf2264
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions packages/piecs/src/collections/SparseSet.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

export type SparseSet = {
readonly values: ArrayLike<number>
has: (value: number) => boolean
Expand All @@ -12,10 +11,6 @@ export const createSparseSet = (): SparseSet => {

const has = (value: number): boolean => {
return values[indices[value]!] === value
// value < indices.length
// && indices[value] !== undefined
// && indices[value]! < values.length
// && values[indices[value]!] === value
}

const add = (value: number) => {
Expand All @@ -30,12 +25,6 @@ export const createSparseSet = (): SparseSet => {
}

const remove = (value: number) => {
/**
* value < indices.length
&& indices[value] !== undefined
&& indices[value]! < values.length
&&
*/
if (values[indices[value]!] === value) {
const swap = values.pop()!
if (swap !== value) {
Expand Down

0 comments on commit dcf2264

Please sign in to comment.