From 4f37a1b9f898bff5f35a11dbd18ce39ebf2655c6 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 17 Aug 2023 14:55:00 -0500 Subject: [PATCH] queries: don't unnecessarily sort things --- src/queries.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/queries.ts b/src/queries.ts index 208fc61..fd41c6a 100644 --- a/src/queries.ts +++ b/src/queries.ts @@ -1,5 +1,5 @@ import { type Event, type Filter, findReplyTag } from '@/deps.ts'; -import { eventDateComparator, type PaginationParams } from '@/utils.ts'; +import { type PaginationParams } from '@/utils.ts'; import { getFilters as getFiltersMixer } from './mixer.ts'; @@ -53,14 +53,12 @@ async function getFeed(pubkey: string, params: PaginationParams): Promise[]> { - const results = await getFiltersMixer([{ kinds: [1], ...params }], { timeout: 5000 }); - return results.sort(eventDateComparator); +function getPublicFeed(params: PaginationParams): Promise[]> { + return getFiltersMixer([{ kinds: [1], ...params }], { timeout: 5000 }); } async function getAncestors(event: Event<1>, result = [] as Event<1>[]): Promise[]> {