diff options
| author | Nippy <nippy@rp1.hu> | 2026-05-09 13:33:09 +0200 |
|---|---|---|
| committer | Nippy <nippy@rp1.hu> | 2026-05-09 13:33:09 +0200 |
| commit | a2b924d7e9492b978ad6dc33b6c1ffcb304b4bc5 (patch) | |
| tree | 1a8769217f84bfe9d6216fafaadaf8cdd876d457 /raveos-hyprland-theme/theme-data/DankMaterialShell/core/internal/utils/slices.go | |
| parent | 34b9c34f982b2596cfa9e368a2d7f74e9a17477c (diff) | |
| download | RaveOS-PKGBUILD-a2b924d7e9492b978ad6dc33b6c1ffcb304b4bc5.tar.gz RaveOS-PKGBUILD-a2b924d7e9492b978ad6dc33b6c1ffcb304b4bc5.zip | |
raveos update
Diffstat (limited to 'raveos-hyprland-theme/theme-data/DankMaterialShell/core/internal/utils/slices.go')
| -rw-r--r-- | raveos-hyprland-theme/theme-data/DankMaterialShell/core/internal/utils/slices.go | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/raveos-hyprland-theme/theme-data/DankMaterialShell/core/internal/utils/slices.go b/raveos-hyprland-theme/theme-data/DankMaterialShell/core/internal/utils/slices.go deleted file mode 100644 index b636ddc..0000000 --- a/raveos-hyprland-theme/theme-data/DankMaterialShell/core/internal/utils/slices.go +++ /dev/null @@ -1,56 +0,0 @@ -package utils - -func Filter[T any](items []T, predicate func(T) bool) []T { - var result []T - for _, item := range items { - if predicate(item) { - result = append(result, item) - } - } - return result -} - -func Find[T any](items []T, predicate func(T) bool) (T, bool) { - for _, item := range items { - if predicate(item) { - return item, true - } - } - var zero T - return zero, false -} - -func Map[T, U any](items []T, transform func(T) U) []U { - result := make([]U, len(items)) - for i, item := range items { - result[i] = transform(item) - } - return result -} - -func Contains[T comparable](items []T, target T) bool { - for _, item := range items { - if item == target { - return true - } - } - return false -} - -func Any[T any](items []T, predicate func(T) bool) bool { - for _, item := range items { - if predicate(item) { - return true - } - } - return false -} - -func All[T any](items []T, predicate func(T) bool) bool { - for _, item := range items { - if !predicate(item) { - return false - } - } - return true -} |