MCPcopy Create free account
hub / github.com/dbProjectRED/redimo.go / Prev

Method Prev

streams.go:86–92  ·  view source on GitHub ↗

Prev returns the previous valid XID at the same time – it simply returns a new XID with the previous sequence number.

()

Source from the content-addressed store, hash-verified

84
85// Prev returns the previous valid XID at the same time – it simply returns a new XID with the previous sequence number.
86func (xid XID) Prev() XID {
87 if xid.Seq() <= 1 {
88 return xid
89 }
90
91 return NewXID(xid.Time(), xid.Seq()-1)
92}
93
94// Time returns the time represented by this XID, accurate to one second.
95func (xid XID) Time() time.Time {

Callers 1

TestRangesFunction · 0.80

Calls 3

SeqMethod · 0.95
TimeMethod · 0.95
NewXIDFunction · 0.85

Tested by 1

TestRangesFunction · 0.64