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

Unified Diff: impl/memory/datastore_index_selection.go

Issue 1365743002: Refactor serialization helpers from impl/memory -> service/datastore/serialize (Closed) Base URL: https://github.com/luci/gae.git@estimate_size
Patch Set: fix comments Created 5 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/memory/datastore_index.go ('k') | impl/memory/datastore_index_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: impl/memory/datastore_index_selection.go
diff --git a/impl/memory/datastore_index_selection.go b/impl/memory/datastore_index_selection.go
index d7dfb6f690deb7d6b6bb4cc7b15cd6371ff60e33..d1601ed9e5235ed873d99f4c14d18420a5400d3e 100644
--- a/impl/memory/datastore_index_selection.go
+++ b/impl/memory/datastore_index_selection.go
@@ -317,11 +317,11 @@ func generate(q *reducedQuery, idx *indexDefinitionSortable, c *constraints) *it
for _, sb := range idx.eqFilts {
val := c.peel(sb.Property)
if sb.Descending {
- val = invert(val)
+ val = serialize.Invert(val)
}
toJoin = append(toJoin, val)
}
- def.prefix = bjoin(toJoin...)
+ def.prefix = serialize.Join(toJoin...)
def.prefixLen = len(def.prefix)
if q.eqFilters["__ancestor__"] != nil && !idx.hasAncestor() {
@@ -354,9 +354,9 @@ func generate(q *reducedQuery, idx *indexDefinitionSortable, c *constraints) *it
// it would be a closed range of EXACTLY this key.
chopped := []byte(anc[:len(anc)-1])
if q.suffixFormat[0].Descending {
- chopped = invert(chopped)
+ chopped = serialize.Invert(chopped)
}
- def.prefix = bjoin(def.prefix, chopped)
+ def.prefix = serialize.Join(def.prefix, chopped)
// Update start and end, since we know that if they contain anything, they
// contain values for the __key__ field.
« no previous file with comments | « impl/memory/datastore_index.go ('k') | impl/memory/datastore_index_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698