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

Unified Diff: impl/memory/raw_datastore_data.go

Issue 1247283003: Improve docs (Closed) Base URL: https://github.com/luci/gae.git@reduce_size
Patch Set: fix comments Created 5 years, 5 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 | « impl/memory/plist.go ('k') | impl/prod/context.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: impl/memory/raw_datastore_data.go
diff --git a/impl/memory/raw_datastore_data.go b/impl/memory/raw_datastore_data.go
index 9ea3624bd9c9225c5f60011dfba8186d06b0a317..497415b6280a315501e95fcc69139151978513c6 100644
--- a/impl/memory/raw_datastore_data.go
+++ b/impl/memory/raw_datastore_data.go
@@ -81,8 +81,8 @@ func curVersion(ents *memCollection, key []byte) int64 {
func incrementLocked(ents *memCollection, key []byte) int64 {
ret := curVersion(ents, key) + 1
buf := &bytes.Buffer{}
- rds.WritePropertyMap(
- buf, rds.PropertyMap{"__version__": {rds.MkPropertyNI(ret)}}, rds.WithContext)
+ rds.PropertyMap{"__version__": {rds.MkPropertyNI(ret)}}.Write(
+ buf, rds.WithContext)
ents.Set(key, buf.Bytes())
return ret
}
@@ -144,7 +144,7 @@ func (d *dataStoreData) putMultiInner(keys []rds.Key, data []rds.PropertyMap) ([
lme := gae.LazyMultiError{Size: len(keys)}
for i, k := range keys {
buf := &bytes.Buffer{}
- rds.WritePropertyMap(buf, data[i], rds.WithoutContext)
+ data[i].Write(buf, rds.WithoutContext)
dataBytes := buf.Bytes()
rKey, err := func() (ret rds.Key, err error) {
@@ -479,11 +479,15 @@ func keyBytes(ctx rds.KeyContext, key rds.Key) []byte {
}
func rpmWoCtx(data []byte, ns string) (rds.PropertyMap, error) {
- return rds.ReadPropertyMap(bytes.NewBuffer(data), rds.WithoutContext, globalAppID, ns)
+ ret := rds.PropertyMap{}
+ err := ret.Read(bytes.NewBuffer(data), rds.WithoutContext, globalAppID, ns)
+ return ret, err
}
func rpm(data []byte) (rds.PropertyMap, error) {
- return rds.ReadPropertyMap(bytes.NewBuffer(data), rds.WithContext, "", "")
+ ret := rds.PropertyMap{}
+ err := ret.Read(bytes.NewBuffer(data), rds.WithContext, "", "")
+ return ret, err
}
func multiValid(keys []rds.Key, plss []rds.PropertyLoadSaver, ns string, potentialKey, allowSpecial bool) error {
« no previous file with comments | « impl/memory/plist.go ('k') | impl/prod/context.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698