mirror of https://github.com/golang/go.git
encoding/xml, image/jpeg, image/png: use the builtin min function
This commit is contained in:
parent
74caf475e3
commit
e037f689bd
|
|
@ -251,13 +251,6 @@ func lookupXMLName(typ reflect.Type) (xmlname *fieldInfo) {
|
|||
return nil
|
||||
}
|
||||
|
||||
func min(a, b int) int {
|
||||
if a <= b {
|
||||
return a
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// addFieldInfo adds finfo to tinfo.fields if there are no
|
||||
// conflicts, or if conflicts arise from previous fields that were
|
||||
// obtained from deeper embedded structures than finfo. In the latter
|
||||
|
|
|
|||
|
|
@ -12,14 +12,6 @@ import (
|
|||
"io"
|
||||
)
|
||||
|
||||
// min returns the minimum of two integers.
|
||||
func min(x, y int) int {
|
||||
if x < y {
|
||||
return x
|
||||
}
|
||||
return y
|
||||
}
|
||||
|
||||
// div returns a/b rounded to the nearest integer, instead of rounded to zero.
|
||||
func div(a, b int32) int32 {
|
||||
if a >= 0 {
|
||||
|
|
|
|||
|
|
@ -136,13 +136,6 @@ type UnsupportedError string
|
|||
|
||||
func (e UnsupportedError) Error() string { return "png: unsupported feature: " + string(e) }
|
||||
|
||||
func min(a, b int) int {
|
||||
if a < b {
|
||||
return a
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func (d *decoder) parseIHDR(length uint32) error {
|
||||
if length != 13 {
|
||||
return FormatError("bad IHDR length")
|
||||
|
|
|
|||
Loading…
Reference in New Issue