diff options
| author | apocelipes <seve3r@outlook.com> | 2023-08-04 03:15:12 +0000 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2023-08-07 00:23:29 +0000 |
| commit | a04f5adc3c748a4bb33d83363b08648d5ba6d79f (patch) | |
| tree | ab2457091b0661758394374319da15c9938a7b9c /src | |
| parent | b55e4a7e26a8663d427264b241a90a5213aa8392 (diff) | |
| download | go-a04f5adc3c748a4bb33d83363b08648d5ba6d79f.tar.xz | |
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>
Diffstat (limited to 'src')
| -rw-r--r-- | src/encoding/xml/typeinfo.go | 7 | ||||
| -rw-r--r-- | src/image/jpeg/writer.go | 8 | ||||
| -rw-r--r-- | src/image/png/reader.go | 7 |
3 files changed, 0 insertions, 22 deletions
diff --git a/src/encoding/xml/typeinfo.go b/src/encoding/xml/typeinfo.go index 12d3918760..b18ed284a6 100644 --- a/src/encoding/xml/typeinfo.go +++ b/src/encoding/xml/typeinfo.go @@ -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 diff --git a/src/image/jpeg/writer.go b/src/image/jpeg/writer.go index 0027f78294..f202d6549c 100644 --- a/src/image/jpeg/writer.go +++ b/src/image/jpeg/writer.go @@ -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 { diff --git a/src/image/png/reader.go b/src/image/png/reader.go index 3a717344c2..e852bb28e8 100644 --- a/src/image/png/reader.go +++ b/src/image/png/reader.go @@ -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") |
