Skip to content

Commit

Permalink
Merge pull request #281 from strideynet/kev-speed-up-didToProfile-lar…
Browse files Browse the repository at this point in the history
…ge-queues

Speed up didToProfile in large queues
  • Loading branch information
KevSlashNull authored Nov 18, 2024
2 parents 5efebe7 + 28f5b4d commit 6b89f2d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion web/admin/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ const currentQueue = ref<keyof typeof queues["value"]>("All");
const error = ref<string>();
const actorProfilesMap = computed(() => {
const map = new Map<string, ProfileViewDetailed>();
for (const profile of actorProfiles.value) {
map.set(profile.did, profile);
}
return map;
});
const queues = computed(() => ({
All: actors.value,
"Probably furry": actors.value.filter((actor) => {
Expand Down Expand Up @@ -59,7 +69,7 @@ const nextActor = async () => {
await nextActor();
function didToProfile(did: string): ProfileViewDetailed | undefined {
return actorProfiles.value.find((p) => p.did === did);
return actorProfilesMap.value.get(did);
}
function selectRandomActor() {
Expand Down

0 comments on commit 6b89f2d

Please sign in to comment.