summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2021-03-21 21:00:59 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2021-03-21 21:00:59 +0900
commit41b491fa7c04900667672cc1832a512568567c55 (patch)
tree55df18246c8b809af3d43fd00b96b717be99d650 /src
parentbetter note read handling (diff)
downloadmisskey-41b491fa7c04900667672cc1832a512568567c55.tar.gz
misskey-41b491fa7c04900667672cc1832a512568567c55.tar.bz2
misskey-41b491fa7c04900667672cc1832a512568567c55.zip
refactor: Use Set
Diffstat (limited to 'src')
-rw-r--r--src/remote/activitypub/deliver-manager.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/remote/activitypub/deliver-manager.ts b/src/remote/activitypub/deliver-manager.ts
index d147b3c9b0..92721f5525 100644
--- a/src/remote/activitypub/deliver-manager.ts
+++ b/src/remote/activitypub/deliver-manager.ts
@@ -76,7 +76,7 @@ export default class DeliverManager {
public async execute() {
if (!Users.isLocalUser(this.actor)) return;
- const inboxes: string[] = [];
+ const inboxes = new Set<string>();
// build inbox list
for (const recipe of this.recipes) {
@@ -89,13 +89,13 @@ export default class DeliverManager {
for (const following of followers) {
if (Followings.isRemoteFollower(following)) {
const inbox = following.followerSharedInbox || following.followerInbox;
- if (!inboxes.includes(inbox)) inboxes.push(inbox);
+ inboxes.add(inbox);
}
}
} else if (isDirect(recipe)) {
// direct deliver
const inbox = recipe.to.inbox;
- if (inbox && !inboxes.includes(inbox)) inboxes.push(inbox);
+ if (inbox) inboxes.add(inbox);
}
}