Skip to content

Commit 2cf77ae

Browse files
committed
refactor(commands): return the recorded keys as a set, matching project-config
Both derivations answer the same question — the set of flag keys a surface admits — so both return ReadonlySet<FlagKey>. Drops a needless set-then-spread on the recorder path; consumers already iterate the value. Refs #2445
1 parent 47942fe commit 2cf77ae

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

‎src/commands/cli-grammar/flag-registry.ts‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,10 @@ export function projectConfigFlagKeys(): ReadonlySet<FlagKey> {
5353
* declaration's `recorded` field. Recomputed per call for the same reason as
5454
* `projectConfigFlagKeys`.
5555
*/
56-
export function recordedFlagKeys(): readonly FlagKey[] {
57-
return [
58-
...new Set(
59-
FLAG_DEFINITIONS.filter((definition) => definition.recorded).map(
60-
(definition) => definition.key,
61-
),
56+
export function recordedFlagKeys(): ReadonlySet<FlagKey> {
57+
return new Set(
58+
FLAG_DEFINITIONS.filter((definition) => definition.recorded).map(
59+
(definition) => definition.key,
6260
),
63-
];
61+
);
6462
}

0 commit comments

Comments
 (0)