Chromium Code Reviews| 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 |