Skip to content

Commit 172e7fa

Browse files
committed
Remove the hand made min and max for various types.
1 parent a06e4b3 commit 172e7fa

File tree

1 file changed

+0
-88
lines changed

1 file changed

+0
-88
lines changed

s2/util.go

Lines changed: 0 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -25,94 +25,6 @@ func roundAngle(val s1.Angle) int32 {
2525
return int32(val + 0.5)
2626
}
2727

28-
// minAngle returns the smallest of the given values.
29-
func minAngle(x s1.Angle, others ...s1.Angle) s1.Angle {
30-
min := x
31-
for _, y := range others {
32-
if y < min {
33-
min = y
34-
}
35-
}
36-
return min
37-
}
38-
39-
// maxAngle returns the largest of the given values.
40-
func maxAngle(x s1.Angle, others ...s1.Angle) s1.Angle {
41-
max := x
42-
for _, y := range others {
43-
if y > max {
44-
max = y
45-
}
46-
}
47-
return max
48-
}
49-
50-
// minChordAngle returns the smallest of the given values.
51-
func minChordAngle(x s1.ChordAngle, others ...s1.ChordAngle) s1.ChordAngle {
52-
min := x
53-
for _, y := range others {
54-
if y < min {
55-
min = y
56-
}
57-
}
58-
return min
59-
}
60-
61-
// maxChordAngle returns the largest of the given values.
62-
func maxChordAngle(x s1.ChordAngle, others ...s1.ChordAngle) s1.ChordAngle {
63-
max := x
64-
for _, y := range others {
65-
if y > max {
66-
max = y
67-
}
68-
}
69-
return max
70-
}
71-
72-
// minFloat64 returns the smallest of the given values.
73-
func minFloat64(x float64, others ...float64) float64 {
74-
min := x
75-
for _, y := range others {
76-
if y < min {
77-
min = y
78-
}
79-
}
80-
return min
81-
}
82-
83-
// maxFloat64 returns the largest of the given values.
84-
func maxFloat64(x float64, others ...float64) float64 {
85-
max := x
86-
for _, y := range others {
87-
if y > max {
88-
max = y
89-
}
90-
}
91-
return max
92-
}
93-
94-
// minInt returns the smallest of the given values.
95-
func minInt(x int, others ...int) int {
96-
min := x
97-
for _, y := range others {
98-
if y < min {
99-
min = y
100-
}
101-
}
102-
return min
103-
}
104-
105-
// maxInt returns the largest of the given values.
106-
func maxInt(x int, others ...int) int {
107-
max := x
108-
for _, y := range others {
109-
if y > max {
110-
max = y
111-
}
112-
}
113-
return max
114-
}
115-
11628
// clampInt returns the number closest to x within the range min..max.
11729
func clampInt(x, min, max int) int {
11830
if x < min {

0 commit comments

Comments
 (0)