File tree Expand file tree Collapse file tree 1 file changed +16
-16
lines changed Expand file tree Collapse file tree 1 file changed +16
-16
lines changed Original file line number Diff line number Diff line change @@ -40,23 +40,23 @@ func (n1 *Count32) Increment(n2 Count32) {
40
40
// AdjustMaxIfNecessary adjusts `*n1` to be `max(*n1, n2)`. Return
41
41
// true iff `n2` was greater than `*n1`.
42
42
func (n1 * Count32 ) AdjustMaxIfNecessary (n2 Count32 ) bool {
43
- if n2 > * n1 {
44
- * n1 = n2
45
- return true
46
- } else {
43
+ if n2 <= * n1 {
47
44
return false
48
45
}
46
+
47
+ * n1 = n2
48
+ return true
49
49
}
50
50
51
51
// AdjustMaxIfPossible adjusts `*n1` to be `max(*n1, n2)`. Return true
52
52
// iff `n2` was greater than or equal to `*n1`.
53
53
func (n1 * Count32 ) AdjustMaxIfPossible (n2 Count32 ) bool {
54
- if n2 >= * n1 {
55
- * n1 = n2
56
- return true
57
- } else {
54
+ if n2 < * n1 {
58
55
return false
59
56
}
57
+
58
+ * n1 = n2
59
+ return true
60
60
}
61
61
62
62
// Count64 is a count of something, capped at math.MaxUint64.
@@ -91,21 +91,21 @@ func (n1 *Count64) Increment(n2 Count64) {
91
91
// AdjustMaxIfNecessary adjusts `*n1` to be `max(*n1, n2)`. Return
92
92
// true iff `n2` was greater than `*n1`.
93
93
func (n1 * Count64 ) AdjustMaxIfNecessary (n2 Count64 ) bool {
94
- if n2 > * n1 {
95
- * n1 = n2
96
- return true
97
- } else {
94
+ if n2 <= * n1 {
98
95
return false
99
96
}
97
+
98
+ * n1 = n2
99
+ return true
100
100
}
101
101
102
102
// AdjustMaxIfPossible adjusts `*n1` to be `max(*n1, n2)`. Return true
103
103
// iff `n2` was greater than or equal to `*n1`.
104
104
func (n1 * Count64 ) AdjustMaxIfPossible (n2 Count64 ) bool {
105
- if n2 > * n1 {
106
- * n1 = n2
107
- return true
108
- } else {
105
+ if n2 <= * n1 {
109
106
return false
110
107
}
108
+
109
+ * n1 = n2
110
+ return true
111
111
}
You can’t perform that action at this time.
0 commit comments