PruneBlobs has O(n²) duplicate snapshot ID detection #16

Open
opened 2026-02-08 17:16:28 +01:00 by clawbot · 0 comments
Collaborator

In prune.go PruneBlobs(), same O(n²) linear scan for duplicate snapshot IDs as RemoveAllSnapshots:

found := false
for _, id := range snapshotIDs {
    if id == snapshotID {
        found = true
        break
    }
}

Use a map[string]bool instead.

Ref: parent issue #1

In `prune.go` `PruneBlobs()`, same O(n²) linear scan for duplicate snapshot IDs as `RemoveAllSnapshots`: ```go found := false for _, id := range snapshotIDs { if id == snapshotID { found = true break } } ``` Use a `map[string]bool` instead. Ref: parent issue #1
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sneak/vaultik#16
No description provided.