Skip to content

Commit 5db344f

Browse files
committed
os/exec: Use the built-in function min instead of minInt
1 parent 977e23a commit 5db344f

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/os/exec/exec.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,7 +1096,7 @@ func (w *prefixSuffixSaver) Write(p []byte) (n int, err error) {
10961096
// grow larger than w.N. It returns the un-appended suffix of p.
10971097
func (w *prefixSuffixSaver) fill(dst *[]byte, p []byte) (pRemain []byte) {
10981098
if remain := w.N - len(*dst); remain > 0 {
1099-
add := minInt(len(p), remain)
1099+
add := min(len(p), remain)
11001100
*dst = append(*dst, p[:add]...)
11011101
p = p[add:]
11021102
}
@@ -1121,13 +1121,6 @@ func (w *prefixSuffixSaver) Bytes() []byte {
11211121
return buf.Bytes()
11221122
}
11231123

1124-
func minInt(a, b int) int {
1125-
if a < b {
1126-
return a
1127-
}
1128-
return b
1129-
}
1130-
11311124
// environ returns a best-effort copy of the environment in which the command
11321125
// would be run as it is currently configured. If an error occurs in computing
11331126
// the environment, it is returned alongside the best-effort copy.

0 commit comments

Comments
 (0)