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

Unified Diff: impl/memory/datastore_data.go

Issue 2342063003: Differentiate between single- and multi- props. (Closed)
Patch Set: Slice is now always a clone. This is marginally worse performance, but a much safer UI. 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 | « impl/cloud/datastore_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 ad8515ee62919e1cf7a84fe942870127170a4043..95d66fb831b7b65dab1d944b8b976ae2f0e58e1c 100644
--- a/impl/memory/datastore_data.go
+++ b/impl/memory/datastore_data.go
@@ -193,8 +193,8 @@ func curVersion(ents memCollection, key []byte) int64 {
pm, err := rpm(v)
memoryCorruption(err)
- pl, ok := pm["__version__"]
- if ok && len(pl) > 0 && pl[0].Type() == ds.PTInt {
+ pl := pm.Slice("__version__")
+ if len(pl) > 0 && pl[0].Type() == ds.PTInt {
return pl[0].Value().(int64)
}
@@ -210,7 +210,7 @@ func incrementLocked(ents memCollection, key []byte, amt int) int64 {
}
ret := curVersion(ents, key) + 1
ents.Set(key, serialize.ToBytes(ds.PropertyMap{
- "__version__": {ds.MkPropertyNI(ret + int64(amt-1))},
+ "__version__": ds.MkPropertyNI(ret + int64(amt-1)),
}))
return ret
}
« no previous file with comments | « impl/cloud/datastore_test.go ('k') | impl/memory/datastore_index.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698