summaryrefslogtreecommitdiff
path: root/identity
diff options
context:
space:
mode:
authorewy <ewy0@protonmail.com>2026-04-22 18:29:37 +0200
committerewy <ewy0@protonmail.com>2026-04-22 18:29:37 +0200
commit374ed5e1a4dc635c42e33e4133729d40cf3e0e35 (patch)
tree01f12ca3eea0154b61afde3d1ee27df2094644e1 /identity
parentee481fa406bb685a16d8b568fca0c9f592c06180 (diff)
work on tests
also replace the annoying search return with a struct
Diffstat (limited to 'identity')
-rw-r--r--identity/identity.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/identity/identity.go b/identity/identity.go
index ee4dfea..1ae13c6 100644
--- a/identity/identity.go
+++ b/identity/identity.go
@@ -8,13 +8,15 @@ type Identity struct {
}
func (i Identity) Is(input string) bool {
- return Reduce(input) == i.Reduced
+ reduced := Reduce(input)
+ return i.Reduced == reduced
}
func New(input string) Identity {
+ reduced := Reduce(input)
return Identity{
Full: input,
- Reduced: Reduce(input),
+ Reduced: reduced,
}
}