Skip to content

Commit d595053

Browse files
committed
up
1 parent f1133fb commit d595053

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/context/commonAttributes.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,11 @@ export function commonAttributes(
1010
context: Context,
1111
inputEntities: ReadonlySet<Entity> | ReadonlyArray<Entity>,
1212
): 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) {
13+
let resultAttributes = context.attributes
14+
for (const inputEntity of inputEntities) {
2115
resultAttributes = setIntersection(
2216
resultAttributes,
23-
attributesOf(context, entity),
17+
attributesOf(context, inputEntity),
2418
)
2519
}
2620

0 commit comments

Comments
 (0)