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

Unified Diff: filter/dscache/support.go

Issue 1292913002: Split off serialization and key functions to their own packages. (Closed) Base URL: https://github.com/luci/gae.git@make_queries_better
Patch Set: rebase 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
« no previous file with comments | « filter/dscache/serialize.go ('k') | impl/dummy/dummy.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: filter/dscache/support.go
diff --git a/filter/dscache/support.go b/filter/dscache/support.go
index f57a9e9df2408c3dfca4353daffdcd043652a0d2..1fc73384528ae3ab2711f460a022ed9f836c15c4 100644
--- a/filter/dscache/support.go
+++ b/filter/dscache/support.go
@@ -60,9 +60,9 @@ func (s *supportContext) mkRandKeys(keys []ds.Key, metas ds.MultiMetaGetter) []s
func (s *supportContext) mkAllKeys(keys []ds.Key) []string {
size := 0
nums := make([]int, len(keys))
- for i, k := range keys {
- if !ds.KeyIncomplete(k) {
- shards := s.numShards(k)
+ for i, key := range keys {
+ if !key.Incomplete() {
+ shards := s.numShards(key)
nums[i] = shards
size += shards
}
@@ -72,7 +72,7 @@ func (s *supportContext) mkAllKeys(keys []ds.Key) []string {
}
ret := make([]string, 0, size)
for i, key := range keys {
- if !ds.KeyIncomplete(key) {
+ if !key.Incomplete() {
keySuffix := HashKey(key)
for shard := 0; shard < nums[i]; shard++ {
ret = append(ret, fmt.Sprintf(KeyFormat, shard, keySuffix))
« no previous file with comments | « filter/dscache/serialize.go ('k') | impl/dummy/dummy.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698