Remove redundant logging in acl/follows.go and get-indexes-from-filter.go, handle nil Tags in event.go.
This commit is contained in:
@@ -157,7 +157,6 @@ func (f *Follows) adminRelays() (urls []string) {
|
|||||||
copy(admins, f.admins)
|
copy(admins, f.admins)
|
||||||
f.followsMx.RUnlock()
|
f.followsMx.RUnlock()
|
||||||
seen := make(map[string]struct{})
|
seen := make(map[string]struct{})
|
||||||
log.I.S(admins)
|
|
||||||
for _, adm := range admins {
|
for _, adm := range admins {
|
||||||
fl := &filter.F{
|
fl := &filter.F{
|
||||||
Authors: tag.NewFromAny(adm),
|
Authors: tag.NewFromAny(adm),
|
||||||
|
|||||||
@@ -362,7 +362,6 @@ func GetIndexesFromFilter(f *filter.F) (idxs []Range, err error) {
|
|||||||
if f.Authors != nil && f.Authors.Len() > 0 {
|
if f.Authors != nil && f.Authors.Len() > 0 {
|
||||||
for _, author := range f.Authors.T {
|
for _, author := range f.Authors.T {
|
||||||
var p *types2.PubHash
|
var p *types2.PubHash
|
||||||
log.I.S(author)
|
|
||||||
if p, err = CreatePubHashFromData(author); chk.E(err) {
|
if p, err = CreatePubHashFromData(author); chk.E(err) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,6 +98,9 @@ func (ev *E) Free() {
|
|||||||
// expansion of the escaped content and tags.
|
// expansion of the escaped content and tags.
|
||||||
func (ev *E) EstimateSize() (size int) {
|
func (ev *E) EstimateSize() (size int) {
|
||||||
size = len(ev.ID)*2 + len(ev.Pubkey)*2 + len(ev.Sig)*2 + len(ev.Content)*2
|
size = len(ev.ID)*2 + len(ev.Pubkey)*2 + len(ev.Sig)*2 + len(ev.Content)*2
|
||||||
|
if ev.Tags == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
for _, v := range *ev.Tags {
|
for _, v := range *ev.Tags {
|
||||||
for _, w := range (*v).T {
|
for _, w := range (*v).T {
|
||||||
size += len(w) * 2
|
size += len(w) * 2
|
||||||
|
|||||||
Reference in New Issue
Block a user