MCPcopy Create free account
hub / github.com/ByteStorage/FlyDB / DeleteRange

Method DeleteRange

lib/datastore/flydb.go:96–107  ·  view source on GitHub ↗

DeleteRange is a method on FlyDbStore that deletes a range of log entries

(min, max uint64)

Source from the content-addressed store, hash-verified

94
95// DeleteRange is a method on FlyDbStore that deletes a range of log entries
96func (fds *FlyDbStore) DeleteRange(min, max uint64) error {
97 for i := min; i <= max; i++ {
98 _ = fds.conn.Delete(uint64ToBytes(i))
99 }
100 if fds.firstIndex >= min && fds.firstIndex <= max {
101 fds.firstIndex = fds.min()
102 }
103 if fds.lastIndex >= min && fds.lastIndex <= max {
104 fds.lastIndex = fds.max()
105 }
106 return nil
107}
108
109// Set is used to store key/value pair
110func (fds *FlyDbStore) Set(key []byte, val []byte) error {

Calls 4

minMethod · 0.95
maxMethod · 0.95
uint64ToBytesFunction · 0.85
DeleteMethod · 0.65