MCPcopy Create free account
hub / github.com/IceFireDB/IceFireDB / Compare

Method Compare

IceFireDB-SQLite/pkg/mysql/mysql/position.go:15–29  ·  view source on GitHub ↗
(o Position)

Source from the content-addressed store, hash-verified

13}
14
15func (p Position) Compare(o Position) int {
16 // First compare binlog name
17 nameCmp := CompareBinlogFileName(p.Name, o.Name)
18 if nameCmp != 0 {
19 return nameCmp
20 }
21 // Same binlog file, compare position
22 if p.Pos > o.Pos {
23 return 1
24 } else if p.Pos < o.Pos {
25 return -1
26 } else {
27 return 0
28 }
29}
30
31func (p Position) String() string {
32 return fmt.Sprintf("(%s, %d)", p.Name, p.Pos)

Callers 2

cmdRPOPLPUSHFunction · 0.45
TestPosCompareMethod · 0.45

Calls 1

CompareBinlogFileNameFunction · 0.70

Tested by 1

TestPosCompareMethod · 0.36