added non-threadsafe Clear (for tests), fixed Fetch

This commit is contained in:
Karl Seguin
2013-10-31 11:45:22 +08:00
parent ba89971ba8
commit 3fa767d9ff
2 changed files with 22 additions and 6 deletions

View File

@@ -45,3 +45,9 @@ func (b *Bucket) getAndDelete(key string) *Item{
delete(b.lookup, key)
return item
}
func (b *Bucket) clear() {
b.Lock()
defer b.Unlock()
b.lookup = make(map[string]*Item)
}