Skip to content

Commit

Permalink
add explanatory comment
Browse files Browse the repository at this point in the history
  • Loading branch information
jassmith committed Jun 11, 2022
1 parent 7422e88 commit ef947c2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/core/src/data-grid/multi-line-layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export function splitMultilineText(ctx: CanvasRenderingContext2D, value: string,
result = result.map((l, i) => (i === 0 ? l : l.trim()));
resultCache.set(key, result);
if (resultCache.size > 500) {
// this is not technically LRU behavior but it works "close enough" and is much cheaper
resultCache.delete(resultCache.keys().next().value);
}
return result;
Expand Down

0 comments on commit ef947c2

Please sign in to comment.