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

Unified Diff: impl/prod/datastore_key.go

Issue 2302743002: Interface update, per-method Contexts. (Closed)
Patch Set: WithoutTransaction, comments, fixes, cleanup. 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
Index: impl/prod/datastore_key.go
diff --git a/impl/prod/datastore_key.go b/impl/prod/datastore_key.go
index 84014ae3b132e67823d3dd3d765fdb0e3df46c93..e4e37e8bb9d9294e474167561ac5a03cadad6b7d 100644
--- a/impl/prod/datastore_key.go
+++ b/impl/prod/datastore_key.go
@@ -21,8 +21,7 @@ func dsR2F(k *datastore.Key) *ds.Key {
if k == nil {
return nil
}
- aid := k.AppID()
- ns := k.Namespace()
+ kc := ds.KeyContext{k.AppID(), k.Namespace()}
count := 0
for nk := k; nk != nil; nk = nk.Parent() {
@@ -37,7 +36,7 @@ func dsR2F(k *datastore.Key) *ds.Key {
toks[count].StringID = k.StringID()
toks[count].IntID = k.IntID()
}
- return ds.NewKeyToks(aid, ns, toks)
+ return kc.NewKeyToks(toks)
}
// dsF2R (DS fake-to-real) converts a DSKey back to an SDK *Key.

Powered by Google App Engine
This is Rietveld 408576698