Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Unified Diff: impl/memory/datastore_data.go

Issue 2353063004: Add "MkKeyContext" KeyContext generation function. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « filter/txnBuf/txnbuf_test.go ('k') | impl/memory/datastore_index.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: impl/memory/datastore_data.go
diff --git a/impl/memory/datastore_data.go b/impl/memory/datastore_data.go
index d41c62129031e0cfe028cf4bfd65514cc2c81370..a8936810e92b626652f32bc1bdf9b132f34a5398 100644
--- a/impl/memory/datastore_data.go
+++ b/impl/memory/datastore_data.go
@@ -176,15 +176,15 @@ func (d *dataStoreData) namespaces() []string {
/////////////////////////// indexes(dataStoreData) ////////////////////////////
func groupMetaKey(key *ds.Key) []byte {
- return keyBytes(ds.KeyContext{}.NewKey("__entity_group__", "", 1, key.Root()))
+ return keyBytes(ds.MkKeyContext("", "").NewKey("__entity_group__", "", 1, key.Root()))
}
func groupIDsKey(key *ds.Key) []byte {
- return keyBytes(ds.KeyContext{}.NewKey("__entity_group_ids__", "", 1, key.Root()))
+ return keyBytes(ds.MkKeyContext("", "").NewKey("__entity_group_ids__", "", 1, key.Root()))
}
func rootIDsKey(kind string) []byte {
- return keyBytes(ds.KeyContext{}.NewKey("__entity_root_ids__", kind, 0, nil))
+ return keyBytes(ds.MkKeyContext("", "").NewKey("__entity_root_ids__", kind, 0, nil))
}
func curVersion(ents memCollection, key []byte) int64 {
@@ -412,7 +412,7 @@ func (d *dataStoreData) canApplyTxn(obj memContextObj) bool {
if len(muts) == 0 { // read-only
continue
}
- prop, err := serialize.ReadProperty(bytes.NewBufferString(rk), serialize.WithContext, ds.KeyContext{})
+ prop, err := serialize.ReadProperty(bytes.NewBufferString(rk), serialize.WithContext, ds.MkKeyContext("", ""))
memoryCorruption(err)
k := prop.Value().(*ds.Key)
@@ -603,7 +603,7 @@ func keyBytes(key *ds.Key) []byte {
func rpm(data []byte) (ds.PropertyMap, error) {
return serialize.ReadPropertyMap(bytes.NewBuffer(data),
- serialize.WithContext, ds.KeyContext{})
+ serialize.WithContext, ds.MkKeyContext("", ""))
}
func namespaces(store memStore) []string {
« no previous file with comments | « filter/txnBuf/txnbuf_test.go ('k') | impl/memory/datastore_index.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698