Files
discord-decomp/_bundle/Module6414.js
T
2026-11-01 12:12:55 +02:00

56 lines
1.2 KiB
JavaScript

// Metro module 6414 (f6415).
export function memoBuilder() {
const WeakSet2 = globalThis.WeakSet;
let c15715_0 = typeof WeakSet2 === "function";
let c15715_1 = typeof WeakSet2 === "function" ? new WeakSet() : [];
return [function memoize(a0) {
let length2;
if (c15715_0) {
let r21 = !!c15715_1.has(a0);
if (!r21) {
c15715_1.add(a0);
r21 = false;
}
return r21;
}
const length = c15715_1.length;
let r0 = 0;
const r11 = 0 < length;
let r8 = c15715_1;
if (r11) {
do {
const r12 = c15715_1[r0];
const r1 = r0;
if (r12 === a0) {
return true;
}
r0 = r1 + 1;
length2 = c15715_1.length;
r8 = c15715_1;
} while (r0 < length2);
}
r8.push(a0);
return false;
}, function unmemoize(a0) {
let r8;
if (c15715_0) {
c15715_1.delete(a0);
} else {
const length = c15715_1.length;
let r0 = 0;
if (0 < length) {
do {
r8 = c15715_1;
const r11 = r8[r0];
const r1 = r0;
if (r11 === a0) {
r8.splice(r1, 1);
break;
}
r0 = r1 + 1;
} while (r0 < r8.length);
}
}
}];
}