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

Unified Diff: impl/memory/datastore_index.go

Issue 2498463003: Fix a bug where deletions weren't updating the raw Kind index. (Closed)
Patch Set: Fix Created 4 years, 1 month 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/memory/datastore_index.go
diff --git a/impl/memory/datastore_index.go b/impl/memory/datastore_index.go
index db3a83c77a4852da0a0817da58e7e035123af04a..98b5267108e5c8a3ad7c102ea98026000b5718f5 100644
--- a/impl/memory/datastore_index.go
+++ b/impl/memory/datastore_index.go
@@ -45,7 +45,10 @@ func defaultIndexes(kind string, pmap ds.PropertyMap) []*ds.IndexDefinition {
}
func indexEntriesWithBuiltins(k *ds.Key, pm ds.PropertyMap, complexIdxs []*ds.IndexDefinition) memStore {
- sip := serialize.PropertyMapPartially(k, pm)
+ var sip serialize.SerializedPmap
+ if pm != nil {
+ sip = serialize.PropertyMapPartially(k, pm)
+ }
return indexEntries(sip, k.Namespace(), append(defaultIndexes(k.Kind(), pm), complexIdxs...))
}
@@ -258,7 +261,7 @@ func addIndexes(store memStore, aid string, compIdx []*ds.IndexDefinition) {
func updateIndexes(store memStore, key *ds.Key, oldEnt, newEnt ds.PropertyMap) {
iannucci 2016/11/12 00:05:47 add comment mentioning that nil has special meanin
// load all current complex query index definitions.
- compIdx := []*ds.IndexDefinition{}
+ var compIdx []*ds.IndexDefinition
walkCompIdxs(store.Snapshot(), nil, func(i *ds.IndexDefinition) bool {
compIdx = append(compIdx, i)
return true

Powered by Google App Engine
This is Rietveld 408576698