Remove LRUCache class migrating to mnemoist (#16872)

This commit is contained in:
Jacob Richman
2026-01-16 13:17:31 -08:00
committed by GitHub
parent d8d4d87e29
commit f2d3b76389
8 changed files with 13 additions and 115 deletions

View File

@@ -8,7 +8,7 @@ import stripAnsi from 'strip-ansi';
import ansiRegex from 'ansi-regex';
import { stripVTControlCharacters } from 'node:util';
import stringWidth from 'string-width';
import { LruCache } from '@google/gemini-cli-core';
import { LRUCache } from 'mnemonist';
import { LRU_BUFFER_PERF_CACHE_LIMIT } from '../constants.js';
/**
@@ -32,7 +32,7 @@ export const getAsciiArtWidth = (asciiArt: string): number => {
// Cache for code points
const MAX_STRING_LENGTH_TO_CACHE = 1000;
const codePointsCache = new LruCache<string, string[]>(
const codePointsCache = new LRUCache<string, string[]>(
LRU_BUFFER_PERF_CACHE_LIMIT,
);
@@ -123,7 +123,7 @@ export function stripUnsafeCharacters(str: string): string {
.join('');
}
const stringWidthCache = new LruCache<string, number>(
const stringWidthCache = new LRUCache<string, number>(
LRU_BUFFER_PERF_CACHE_LIMIT,
);