mirror of
https://github.com/dolthub/dolt.git
synced 2026-01-24 03:09:22 -06:00
Introduce the 'NopStore', which is a sorta-ChunkStore that throws away all written data. Get() can't really be called on it, as a result, but it's useful for taking IO totally out of the equation when testing our code for performance. Towards issue #67
19 lines
324 B
Go
19 lines
324 B
Go
package chunks
|
|
|
|
import "github.com/attic-labs/noms/ref"
|
|
|
|
type memoryRootTracker ref.Ref
|
|
|
|
func (ms *memoryRootTracker) Root() ref.Ref {
|
|
return ref.Ref(*ms)
|
|
}
|
|
|
|
func (ms *memoryRootTracker) UpdateRoot(current, last ref.Ref) bool {
|
|
if last != ref.Ref(*ms) {
|
|
return false
|
|
}
|
|
|
|
*ms = memoryRootTracker(current)
|
|
return true
|
|
}
|