File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -427,14 +427,14 @@ func (r *ChunkRef) Less(other ChunkRef) bool {
427
427
428
428
func (r * ChunkRef ) Cmp (other ChunkRef ) int {
429
429
if r .From != other .From {
430
- return int (other .From ) - int (r .From )
430
+ return int (r .From ) - int (other .From )
431
431
}
432
432
433
433
if r .Through != other .Through {
434
- return int (other .Through ) - int (r .Through )
434
+ return int (r .Through ) - int (other .Through )
435
435
}
436
436
437
- return int (other .Checksum ) - int (r .Checksum )
437
+ return int (r .Checksum ) - int (other .Checksum )
438
438
}
439
439
440
440
func (r * ChunkRef ) Encode (enc * encoding.Encbuf , previousEnd model.Time ) model.Time {
Original file line number Diff line number Diff line change @@ -74,42 +74,42 @@ func TestChunkRefCmpLess(t *testing.T) {
74
74
desc : "From is before" ,
75
75
left : ChunkRef {0 , 1 , 0 },
76
76
right : ChunkRef {1 , 1 , 0 },
77
- expCmp : 1 ,
77
+ expCmp : - 1 ,
78
78
expLess : true ,
79
79
},
80
80
{
81
81
desc : "From is after" ,
82
82
left : ChunkRef {1 , 1 , 0 },
83
83
right : ChunkRef {0 , 1 , 0 },
84
- expCmp : - 1 ,
84
+ expCmp : 1 ,
85
85
expLess : false ,
86
86
},
87
87
{
88
88
desc : "Through is before" ,
89
89
left : ChunkRef {0 , 1 , 0 },
90
90
right : ChunkRef {0 , 2 , 0 },
91
- expCmp : 1 ,
91
+ expCmp : - 1 ,
92
92
expLess : true ,
93
93
},
94
94
{
95
95
desc : "Through is after" ,
96
96
left : ChunkRef {0 , 2 , 0 },
97
97
right : ChunkRef {0 , 1 , 0 },
98
- expCmp : - 1 ,
98
+ expCmp : 1 ,
99
99
expLess : false ,
100
100
},
101
101
{
102
102
desc : "Checksum is smaller" ,
103
103
left : ChunkRef {0 , 1 , 0 },
104
104
right : ChunkRef {0 , 1 , 1 },
105
- expCmp : 1 ,
105
+ expCmp : - 1 ,
106
106
expLess : true ,
107
107
},
108
108
{
109
109
desc : "Checksum is bigger" ,
110
110
left : ChunkRef {0 , 0 , 1 },
111
111
right : ChunkRef {0 , 0 , 0 },
112
- expCmp : - 1 ,
112
+ expCmp : 1 ,
113
113
expLess : false ,
114
114
},
115
115
} {
You can’t perform that action at this time.
0 commit comments