mirror of
https://github.com/ruvnet/ruflo.git
synced 2026-11-24 14:16:34 +09:00
Checkpoint: File edits
Automatic checkpoint created by Claude Code - Branch: claude/guidance-control-plane-uhmR3 - Timestamp: 2026-02-02T03:50:43Z - Changes: 1 file(s) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5a73c9af58
commit
010943b83d
1 file changed
+5
-3
@@ -427,14 +427,16 @@ export class ThreatDetector {
|
||||
}
|
||||
|
||||
/**
|
||||
* Add signal with LRU eviction
|
||||
* Add signal with batch eviction.
|
||||
* Trims 10% at once to amortize the O(n) splice cost instead of
|
||||
* calling shift() (O(n)) on every insertion.
|
||||
*/
|
||||
private addSignal(signal: ThreatSignal): void {
|
||||
this.signals.push(signal);
|
||||
|
||||
// LRU eviction
|
||||
if (this.signals.length > this.maxSignals) {
|
||||
this.signals.shift();
|
||||
const trimCount = Math.max(1, Math.floor(this.maxSignals * 0.1));
|
||||
this.signals.splice(0, trimCount);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user