Skip to content

Commit 8d0a4ea

Browse files
l0lawrenceCopilot
andcommitted
Tidy baseline-cache doc comments
Drop the now-redundant computeBaselineProfileKey note and remove the stale 'cache paths are safe' clause from tryReuseBaselineOutput (the safety check was removed). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 8c6a290 commit 8d0a4ea

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

eng/emitter-diff/src/baseline-cache.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ interface BaselineCacheIndexEntry {
2424
type BaselineCacheIndex = Record<string, BaselineCacheIndexEntry>;
2525

2626
export function computeBaselineProfileKey(input: BaselineCacheProfileInput): string {
27-
// The input is always constructed with a fixed key order and contains only
28-
// strings and string arrays, so JSON.stringify already produces a stable,
29-
// deterministic key across runs.
3027
return createHash("sha256").update(JSON.stringify(input)).digest("hex").slice(0, 16);
3128
}
3229

@@ -86,9 +83,9 @@ function persistBaselineIndex(index: BaselineCacheIndex, log: Logger): void {
8683
/**
8784
* Reuse a previously cached baseline output for `profileKey` into `snapshotDir`,
8885
* but only when the cache entry's identity matches `baselineIdentity` (so a
89-
* moved branch or edited source invalidates it) and the cache paths are safe.
90-
* Returns whether the cached output was reused; a miss or any error returns
91-
* false so the caller regenerates.
86+
* moved branch or edited source invalidates it). Returns whether the cached
87+
* output was reused; a miss or any error returns false so the caller
88+
* regenerates.
9289
*/
9390
export function tryReuseBaselineOutput(
9491
profileKey: string,

0 commit comments

Comments
 (0)