]> Cypherpunks repositories - gostls13.git/commitdiff
encoding/xml, image/jpeg, image/png: use the builtin min function
authorapocelipes <seve3r@outlook.com>
Fri, 4 Aug 2023 03:15:12 +0000 (03:15 +0000)
committerGopher Robot <gobot@golang.org>
Mon, 7 Aug 2023 00:23:29 +0000 (00:23 +0000)
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>

src/encoding/xml/typeinfo.go
src/image/jpeg/writer.go
src/image/png/reader.go

index 12d3918760472f2d38bcd1329e8994342420bebb..b18ed284a690ca08247e504f2d0b819100906a59 100644 (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
index 0027f78294a25966541529e0fd69bea1354cabdc..f202d6549c461c5351777768fb4f01e2ddf0776b 100644 (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 {
index 3a717344c27998f989fcaa47a4c282685ae23629..e852bb28e81d808faf1d03a99b5c1f00de41ecd9 100644 (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")