better autocomplete
This commit is contained in:
@@ -111,3 +111,12 @@ func inorder(a, b string) bool {
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// Metrics gets the number of buckets in the autocomplete set and the length
|
||||
// of the longest bucket.
|
||||
func (s *Set) Metrics() (buckets, longest int) {
|
||||
for _, b := range s.keys {
|
||||
longest = max(longest, len(b))
|
||||
}
|
||||
return len(s.keys), longest
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user