Skip to content

Commit 1da8a18

Browse files
committed
removed code
1 parent c07c292 commit 1da8a18

File tree

1 file changed

+0
-32
lines changed

1 file changed

+0
-32
lines changed

src/primitives/functions.ts

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,6 @@ export const binarySorted_insert = (message: Msg, messages: Msgs) => {
293293
}
294294
//? insert message
295295
messages.splice(low, 0, message);
296-
297296
return messages;
298297
};
299298

@@ -588,34 +587,3 @@ export function intersect(arrays: ReadonlyArray<number>[]): number[] {
588587
return count === arrays.length;
589588
});
590589
}
591-
592-
// please fix
593-
// fix function has a bug
594-
// it adds up a one log file more than once, hence doubling the items in the entire db
595-
async function _find(query: QueryType<Record<string, any>>) {
596-
let RCTied = await getLog(query.one);
597-
if (query.many) {
598-
// ? skip results
599-
if (query.skip && query.skip < RCTied.length) {
600-
RCTied = RCTied.slice(query.skip);
601-
}
602-
const take = query.take || 1000;
603-
if (RCTied.length > take) {
604-
RCTied = RCTied.slice(0);
605-
} else {
606-
const logsCount = Object.keys(_LogFiles).length;
607-
for (let log = 2; RCTied.length < take; log++) {
608-
console.log({ RCTied: RCTied.length, logsCount, log });
609-
const RCTied2 = await getLog(undefined, log);
610-
Array.prototype.push.apply(RCTied, RCTied2);
611-
if (query.skip && query.skip < RCTied.length) {
612-
RCTied = RCTied.slice(query.skip);
613-
}
614-
// ? break an endless loop.
615-
if (log > logsCount) {
616-
break;
617-
}
618-
}
619-
}
620-
}
621-
}

0 commit comments

Comments
 (0)