mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-23 23:37:09 +00:00
optimise LatestMap.Merge by merging old into young
This commit is contained in:
7
vendor/github.com/weaveworks/ps/map.go
generated
vendored
7
vendor/github.com/weaveworks/ps/map.go
generated
vendored
@@ -42,6 +42,9 @@ type Map interface {
|
||||
// This operation is O(log N) in the number of keys.
|
||||
Lookup(key string) (interface{}, bool)
|
||||
|
||||
// First returns the "first" value in the map, if any, or nil.
|
||||
First() interface{}
|
||||
|
||||
// Size returns the number of key value pairs in the map.
|
||||
// This takes O(1) time.
|
||||
Size() int
|
||||
@@ -348,6 +351,10 @@ func lookupLowLevel(self *tree, partialHash, hash uint64) (interface{}, bool) {
|
||||
return self.value, true
|
||||
}
|
||||
|
||||
func (m *tree) First() interface{} {
|
||||
return m.value
|
||||
}
|
||||
|
||||
func (m *tree) Size() int {
|
||||
return m.count
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user