We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f1133fb commit d595053Copy full SHA for d595053
src/context/commonAttributes.ts
@@ -10,17 +10,11 @@ export function commonAttributes(
10
context: Context,
11
inputEntities: ReadonlySet<Entity> | ReadonlyArray<Entity>,
12
): ReadonlySet<Attribute> {
13
- inputEntities = Array.from(inputEntities)
14
- if (inputEntities.length === 0) {
15
- return context.attributes
16
- }
17
-
18
- const [firstEntity, ...restEntities] = inputEntities
19
- let resultAttributes = attributesOf(context, firstEntity)
20
- for (const entity of restEntities) {
+ let resultAttributes = context.attributes
+ for (const inputEntity of inputEntities) {
21
resultAttributes = setIntersection(
22
resultAttributes,
23
- attributesOf(context, entity),
+ attributesOf(context, inputEntity),
24
)
25
}
26
0 commit comments