mirror of
https://github.com/siteboon/claudecodeui.git
synced 2026-02-14 20:57:32 +00:00
refactor(createCachedDiffCalculator): use both newStr and oldStr as cache keys
This commit is contained in:
@@ -87,7 +87,7 @@ export const createCachedDiffCalculator = (): DiffCalculator => {
|
|||||||
const cache = new Map<string, DiffLine[]>();
|
const cache = new Map<string, DiffLine[]>();
|
||||||
|
|
||||||
return (oldStr: string, newStr: string) => {
|
return (oldStr: string, newStr: string) => {
|
||||||
const key = `${oldStr.length}-${newStr.length}-${oldStr.slice(0, 50)}`;
|
const key = JSON.stringify([oldStr, newStr]);
|
||||||
const cached = cache.get(key);
|
const cached = cache.get(key);
|
||||||
if (cached) {
|
if (cached) {
|
||||||
return cached;
|
return cached;
|
||||||
|
|||||||
Reference in New Issue
Block a user