mirror of https://github.com/golang/go.git
encoding/xml, image/jpeg, image/png: use the builtin min function
Change-Id: I9bafc7aa4e20e7cd994b75e7576156ca68f4fc8b
GitHub-Last-Rev: e037f689bd
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
|
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
|
// addFieldInfo adds finfo to tinfo.fields if there are no
|
||||||
// conflicts, or if conflicts arise from previous fields that were
|
// conflicts, or if conflicts arise from previous fields that were
|
||||||
// obtained from deeper embedded structures than finfo. In the latter
|
// obtained from deeper embedded structures than finfo. In the latter
|
||||||
|
|
|
||||||
|
|
@ -12,14 +12,6 @@ import (
|
||||||
"io"
|
"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.
|
// div returns a/b rounded to the nearest integer, instead of rounded to zero.
|
||||||
func div(a, b int32) int32 {
|
func div(a, b int32) int32 {
|
||||||
if a >= 0 {
|
if a >= 0 {
|
||||||
|
|
|
||||||
|
|
@ -136,13 +136,6 @@ type UnsupportedError string
|
||||||
|
|
||||||
func (e UnsupportedError) Error() string { return "png: unsupported feature: " + string(e) }
|
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 {
|
func (d *decoder) parseIHDR(length uint32) error {
|
||||||
if length != 13 {
|
if length != 13 {
|
||||||
return FormatError("bad IHDR length")
|
return FormatError("bad IHDR length")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue