summaryrefslogtreecommitdiffstats
path: root/modules/util
diff options
context:
space:
mode:
authorShiny Nematoda <snematoda.751k2@aleeas.com>2024-03-28 12:46:41 +0100
committerShiny Nematoda <snematoda.751k2@aleeas.com>2024-03-28 12:46:41 +0100
commita38260aed9df55e3615a1c7388c69696919943fe (patch)
tree79ef8dbd42d968cb4060bdde0d26f335ec534ca7 /modules/util
parentMerge pull request '[PERFORMANCE] git check-attr on bare repo if supported' (... (diff)
downloadforgejo-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.go9
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
-}