diff options
author | Shiny Nematoda <snematoda.751k2@aleeas.com> | 2024-03-28 12:46:41 +0100 |
---|---|---|
committer | Shiny Nematoda <snematoda.751k2@aleeas.com> | 2024-03-28 12:46:41 +0100 |
commit | a38260aed9df55e3615a1c7388c69696919943fe (patch) | |
tree | 79ef8dbd42d968cb4060bdde0d26f335ec534ca7 /modules/util | |
parent | Merge pull request '[PERFORMANCE] git check-attr on bare repo if supported' (... (diff) | |
download | forgejo-a38260aed9df55e3615a1c7388c69696919943fe.tar.xz forgejo-a38260aed9df55e3615a1c7388c69696919943fe.zip |
Revert "cherry pick only `IfZero` from (#29755)"
This reverts commit 82851f429a590e8a33025ac030413f0b84e8404c.
Diffstat (limited to 'modules/util')
-rw-r--r-- | modules/util/util.go | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/modules/util/util.go b/modules/util/util.go index c94fb91047..5c75158196 100644 --- a/modules/util/util.go +++ b/modules/util/util.go @@ -212,12 +212,3 @@ func ToFloat64(number any) (float64, error) { func ToPointer[T any](val T) *T { return &val } - -// IfZero returns "def" if "v" is a zero value, otherwise "v" -func IfZero[T comparable](v, def T) T { - var zero T - if v == zero { - return def - } - return v -} |