case insensitive peer lookup

This commit is contained in:
Matthias Hannig 2017-06-30 11:22:35 +02:00
parent f3b7a82091
commit 2c5c3eea32
2 changed files with 2 additions and 3 deletions

View File

@ -4,7 +4,6 @@ import (
"github.com/ecix/alice-lg/backend/api"
"log"
"strings"
"time"
)
@ -120,7 +119,7 @@ func (self *NeighboursStore) LookupNeighboursAt(
neighbours := self.neighboursMap[sourceId]
for _, neighbour := range neighbours {
if !strings.Contains(neighbour.Description, query) {
if !ContainsCi(neighbour.Description, query) {
continue
}

View File

@ -64,7 +64,7 @@ func TestNeighbourLookupAt(t *testing.T) {
"ID2233_AS2343",
}
neighbours := store.LookupNeighboursAt(1, "Peer 1")
neighbours := store.LookupNeighboursAt(1, "peer 1")
// Make index
index := NeighboursIndex{}