move everything to the same directory.

This commit is contained in:
fiatjaf
2022-01-02 08:44:18 -03:00
parent 44604e406b
commit d131e8460e
10 changed files with 192 additions and 196 deletions

64
filter_aux.go Normal file
View File

@@ -0,0 +1,64 @@
package nostr
type StringList []string
type IntList []int
func (as StringList) Equals(bs StringList) bool {
if len(as) != len(bs) {
return false
}
for _, a := range as {
for _, b := range bs {
if b == a {
goto next
}
}
// didn't find a B that corresponded to the current A
return false
next:
continue
}
return true
}
func (as IntList) Equals(bs IntList) bool {
if len(as) != len(bs) {
return false
}
for _, a := range as {
for _, b := range bs {
if b == a {
goto next
}
}
// didn't find a B that corresponded to the current A
return false
next:
continue
}
return true
}
func (haystack StringList) Contains(needle string) bool {
for _, hay := range haystack {
if hay == needle {
return true
}
}
return false
}
func (haystack IntList) Contains(needle int) bool {
for _, hay := range haystack {
if hay == needle {
return true
}
}
return false
}