mirror of
https://github.com/golang/go
synced 2024-11-23 05:20:11 -07:00
os/exec: Use the built-in function min
instead of minInt
This commit is contained in:
parent
977e23a707
commit
5db344f131
@ -1096,7 +1096,7 @@ func (w *prefixSuffixSaver) Write(p []byte) (n int, err error) {
|
||||
// grow larger than w.N. It returns the un-appended suffix of p.
|
||||
func (w *prefixSuffixSaver) fill(dst *[]byte, p []byte) (pRemain []byte) {
|
||||
if remain := w.N - len(*dst); remain > 0 {
|
||||
add := minInt(len(p), remain)
|
||||
add := min(len(p), remain)
|
||||
*dst = append(*dst, p[:add]...)
|
||||
p = p[add:]
|
||||
}
|
||||
@ -1121,13 +1121,6 @@ func (w *prefixSuffixSaver) Bytes() []byte {
|
||||
return buf.Bytes()
|
||||
}
|
||||
|
||||
func minInt(a, b int) int {
|
||||
if a < b {
|
||||
return a
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// environ returns a best-effort copy of the environment in which the command
|
||||
// would be run as it is currently configured. If an error occurs in computing
|
||||
// the environment, it is returned alongside the best-effort copy.
|
||||
|
Loading…
Reference in New Issue
Block a user