Cap identicon cache size

500 seems a reasonable size for what you would encounter at most in a view or two.
Realistically not an issue but just a defensive
fix.
This commit is contained in:
Kalle
2026-05-11 20:32:37 +03:00
parent 4a021cc1ce
commit 3dea845ce5

View File

@@ -1,4 +1,5 @@
import clsx from "clsx";
import { LRUCache } from "lru-cache";
import * as React from "react";
import type { Tables } from "~/db/tables";
import { useHydrated } from "~/hooks/useHydrated";
@@ -18,7 +19,7 @@ const dimensions = {
lg: 125,
} as const;
const identiconCache = new Map<string, string>();
const identiconCache = new LRUCache<string, string>({ max: 500 });
function hashString(str: string) {
let hash = 5381;