Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

Commit e35e1a7

Browse files
authored
Merge pull request #586 from davecheney/internal-gps-unused
internal/gps: remove unused code
2 parents 06a4f0b + 37c5f88 commit e35e1a7

File tree

1 file changed

+0
-30
lines changed

1 file changed

+0
-30
lines changed

internal/gps/typed_radix.go

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,6 @@ func (t *deducerTrie) Delete(s string) (pathDeducer, bool) {
4040
return nil, false
4141
}
4242

43-
// Get is used to lookup a specific key, returning the value and if it was found
44-
func (t *deducerTrie) Get(s string) (pathDeducer, bool) {
45-
t.RLock()
46-
defer t.RUnlock()
47-
if d, has := t.t.Get(s); has {
48-
return d.(pathDeducer), has
49-
}
50-
return nil, false
51-
}
52-
5343
// Insert is used to add a newentry or update an existing entry. Returns if updated.
5444
func (t *deducerTrie) Insert(s string, d pathDeducer) (pathDeducer, bool) {
5545
t.Lock()
@@ -60,13 +50,6 @@ func (t *deducerTrie) Insert(s string, d pathDeducer) (pathDeducer, bool) {
6050
return nil, false
6151
}
6252

63-
// Len is used to return the number of elements in the tree
64-
func (t *deducerTrie) Len() int {
65-
t.RLock()
66-
defer t.RUnlock()
67-
return t.t.Len()
68-
}
69-
7053
// LongestPrefix is like Get, but instead of an exact match, it will return the
7154
// longest prefix match.
7255
func (t *deducerTrie) LongestPrefix(s string) (string, pathDeducer, bool) {
@@ -78,19 +61,6 @@ func (t *deducerTrie) LongestPrefix(s string) (string, pathDeducer, bool) {
7861
return "", nil, false
7962
}
8063

81-
// ToMap is used to walk the tree and convert it to a map.
82-
func (t *deducerTrie) ToMap() map[string]pathDeducer {
83-
m := make(map[string]pathDeducer)
84-
t.RLock()
85-
t.t.Walk(func(s string, d interface{}) bool {
86-
m[s] = d.(pathDeducer)
87-
return false
88-
})
89-
90-
t.RUnlock()
91-
return m
92-
}
93-
9464
// isPathPrefixOrEqual is an additional helper check to ensure that the literal
9565
// string prefix returned from a radix tree prefix match is also a path tree
9666
// match.

0 commit comments

Comments
 (0)