mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-08-28 14:18:04 -05:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user