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

Unified Diff: service/datastore/index.go

Issue 1302813003: impl/memory: Implement Queries (Closed) Base URL: https://github.com/luci/gae.git@add_multi_iterator
Patch Set: Created 5 years, 4 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: service/datastore/index.go
diff --git a/service/datastore/index.go b/service/datastore/index.go
index 0f1aaca469903e6cef8ba46bda5073dbb22f61f9..0c50541e0ab877dedffc0a7942dfc61e73931e15 100644
--- a/service/datastore/index.go
+++ b/service/datastore/index.go
@@ -39,6 +39,18 @@ type IndexDefinition struct {
SortBy []IndexColumn
}
+func (id *IndexDefinition) Equal(o *IndexDefinition) bool {
+ if id.Kind != o.Kind || id.Ancestor != o.Ancestor || len(id.SortBy) != len(o.SortBy) {
+ return false
+ }
+ for i, col := range id.SortBy {
+ if col != o.SortBy[i] {
+ return false
+ }
+ }
+ return true
+}
+
// Yeah who needs templates, right?
// <flames>This is fine.</flames>

Powered by Google App Engine
This is Rietveld 408576698