encoding/xml, image/jpeg, image/png: use the builtin min function

This commit is contained in:
apocelipes 2023-08-04 12:03:06 +09:00
parent 74caf475e3
commit e037f689bd
3 changed files with 0 additions and 22 deletions

View File

@ -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

View File

@ -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 {

View File

@ -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")