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

Unified Diff: go/src/infra/gae/libs/gae/memory/plist.go

Issue 1242043005: Improve memory implementation of gae to provide the full RawDatastore interface. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@port_broken_features
Patch Set: further simplification of CL 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
Index: go/src/infra/gae/libs/gae/memory/plist.go
diff --git a/go/src/infra/gae/libs/gae/memory/plist.go b/go/src/infra/gae/libs/gae/memory/plist.go
index 13f9bc8b9511006ebd0fb600ec2c78a282244415..59a2cc39709ca6d7e97d8fcfad776e03e4158942 100644
--- a/go/src/infra/gae/libs/gae/memory/plist.go
+++ b/go/src/infra/gae/libs/gae/memory/plist.go
@@ -226,9 +226,7 @@ func (sip serializedIndexablePmap) indexEntries(k gae.DSKey, idxs []*qIndex) *me
return ret
}
-func updateIndicies(store *memStore, key gae.DSKey, oldEnt, newEnt gae.DSPropertyMap) error {
- var err error
-
+func updateIndicies(store *memStore, key gae.DSKey, oldEnt, newEnt gae.DSPropertyMap) {
idxColl := store.GetCollection("idx")
if idxColl == nil {
idxColl = store.SetCollection("idx", nil)
@@ -241,15 +239,12 @@ func updateIndicies(store *memStore, key gae.DSKey, oldEnt, newEnt gae.DSPropert
return false
}
qi := &qIndex{}
- if err = qi.ReadBinary(bytes.NewBuffer(i.Key)); err != nil {
- return false
+ if err := qi.ReadBinary(bytes.NewBuffer(i.Key)); err != nil {
+ panic(err) // memory corruption
}
compIdx = append(compIdx, qi)
return true
})
- if err != nil {
- return err
- }
oldIdx := indexEntriesWithBuiltins(key, oldEnt, compIdx)
@@ -293,6 +288,4 @@ func updateIndicies(store *memStore, key gae.DSKey, oldEnt, newEnt gae.DSPropert
// TODO(riannucci): remove entries from idxColl and remove index collections
// when there are no index entries for that index any more.
})
-
- return nil
}

Powered by Google App Engine
This is Rietveld 408576698