lmdb/badger: fix duplicate identification code for tag indexing.
This commit is contained in:
@@ -92,7 +92,8 @@ func getIndexKeysForEvent(evt *nostr.Event, idx []byte) [][]byte {
|
|||||||
// not indexable
|
// not indexable
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if i > 0 && evt.Tags[i-1][1] == tag[1] {
|
firstIndex := slices.IndexFunc(evt.Tags, func(t nostr.Tag) bool { return len(t) >= 2 && t[1] == tag[1] })
|
||||||
|
if firstIndex != i {
|
||||||
// duplicate
|
// duplicate
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,7 +85,8 @@ func (b *LMDBBackend) getIndexKeysForEvent(evt *nostr.Event) []key {
|
|||||||
// not indexable
|
// not indexable
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if i > 0 && evt.Tags[i-1][1] == tag[1] {
|
firstIndex := slices.IndexFunc(evt.Tags, func(t nostr.Tag) bool { return len(t) >= 2 && t[1] == tag[1] })
|
||||||
|
if firstIndex != i {
|
||||||
// duplicate
|
// duplicate
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user