mirror of
https://github.com/golang/go.git
synced 2025-05-22 16:09:37 +00:00
encoding/xml, image/jpeg, image/png: use the builtin min function
Change-Id: I9bafc7aa4e20e7cd994b75e7576156ca68f4fc8b GitHub-Last-Rev: e037f689bddd0ef03a6ad38982fe98b4c26aaede GitHub-Pull-Request: golang/go#61746 Reviewed-on: https://go-review.googlesource.com/c/go/+/515855 Run-TryBot: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com>
This commit is contained in:
parent
b55e4a7e26
commit
a04f5adc3c
@ -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…
x
Reference in New Issue
Block a user