MCPcopy Create free account
hub / github.com/evilsocket/sum / AllBut

Method AllBut

wrapper/records.go:43–53  ·  view source on GitHub ↗

AllBut returns a wrapped list of records in the current storage but the one specified.

(exclude *Record)

Source from the content-addressed store, hash-verified

41// AllBut returns a wrapped list of records in the current storage
42// but the one specified.
43func (w Records) AllBut(exclude *Record) []*Record {
44 wrapped := make([]*Record, 0)
45 w.records.ForEach(func(m proto.Message) error {
46 record := m.(*pb.Record)
47 if record.Id != exclude.record.Id {
48 wrapped = append(wrapped, WrapRecord(record))
49 }
50 return nil
51 })
52 return wrapped
53}
54
55// CreateRecord creates a new record from raw data.
56func (w Records) CreateRecord(data []float32) *Record {

Callers 2

TestWrappedRecordsAllButFunction · 0.80

Calls 2

WrapRecordFunction · 0.85
ForEachMethod · 0.80

Tested by 2

TestWrappedRecordsAllButFunction · 0.64