diff options
Diffstat (limited to 'src/vendor/golang.org/x/net/quic/math.go')
| -rw-r--r-- | src/vendor/golang.org/x/net/quic/math.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/vendor/golang.org/x/net/quic/math.go b/src/vendor/golang.org/x/net/quic/math.go new file mode 100644 index 0000000000..d1e8a80025 --- /dev/null +++ b/src/vendor/golang.org/x/net/quic/math.go @@ -0,0 +1,12 @@ +// Copyright 2023 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package quic + +func abs[T ~int | ~int64](a T) T { + if a < 0 { + return -a + } + return a +} |
