TASK-005: Replace manual Set creation with precomputed getEffectivelyEnabledItems for O(1) performance (#37)
This commit is contained in:
commit
d77f8e80bd
@ -101,25 +101,10 @@ async function applyConfig(configPath = "awesome-copilot.config.yml") {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Import config manager for effective state computation
|
// Import config manager for effective state computation
|
||||||
const { computeEffectiveItemStates } = require("./config-manager");
|
const { getEffectivelyEnabledItems } = require("./config-manager");
|
||||||
|
|
||||||
// Compute effective states using precedence rules
|
// Get precomputed sets of effectively enabled items for O(1) performance
|
||||||
const effectiveStates = computeEffectiveItemStates(config);
|
const effectivelyEnabledSets = getEffectivelyEnabledItems(config);
|
||||||
|
|
||||||
// Create sets of effectively enabled items for performance
|
|
||||||
const effectivelyEnabledSets = {
|
|
||||||
prompts: new Set(),
|
|
||||||
instructions: new Set(),
|
|
||||||
chatmodes: new Set()
|
|
||||||
};
|
|
||||||
|
|
||||||
for (const section of ["prompts", "instructions", "chatmodes"]) {
|
|
||||||
for (const [itemName, state] of Object.entries(effectiveStates[section])) {
|
|
||||||
if (state.enabled) {
|
|
||||||
effectivelyEnabledSets[section].add(itemName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Count enabled collections for summary
|
// Count enabled collections for summary
|
||||||
if (config.collections) {
|
if (config.collections) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user