Skip to content

Commit

Permalink
Add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Dec 19, 2021
1 parent 76b2ca3 commit a547121
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/combination/ids/namespace.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ import { getCombDimensions } from '../dimensions.js'
import { getDimensionId, setDimensionId } from './get.js'
import { isSameId, isSameDimension } from './has.js'

// We previously ensured that each `id` is unique within each dimension.
// This logic ensures each `id` is also unique across dimensions.
// We do this by prefixing the dimension's name to the `id` when we find
// cross-dimensions duplicates.
// We only do so on the previous result's id, not on the most recent, so those
// ids look simpler to users.
// Since the number of results can be large, this is optimized for performance.
// - We try to avoid creating new objects and arrays unless a mutation is
// actually needed, i.e. some id needs to be namespaced
Expand Down

0 comments on commit a547121

Please sign in to comment.