refactored data-types to reduce plugin sizes
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
// Copyright (c) 2024-2026 Celestino Amoroso (celestino.amoroso@gmail.com).
|
||||
// All rights reserved.
|
||||
|
||||
// equaler.go
|
||||
package kern
|
||||
|
||||
type Equaler interface {
|
||||
EqualTo(other Equaler) bool
|
||||
}
|
||||
|
||||
func IsEqualer(v any) (ok bool) {
|
||||
_, ok = v.(Equaler)
|
||||
return
|
||||
}
|
||||
|
||||
func Equal(a, b any) (equal bool) {
|
||||
if IsEqualer(a) && IsEqualer(b) {
|
||||
equal = a.(Equaler).EqualTo(b.(Equaler))
|
||||
} else {
|
||||
equal = a == b
|
||||
}
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user