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

Side by Side Diff: filter/txnBuf/query_merger.go

Issue 1846123002: Fix missing/broken ds.Stop handling in raw DS. (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/gae@master
Patch Set: Better "count" helper function. Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « filter/dscache/ds.go ('k') | filter/txnBuf/state.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package txnBuf 5 package txnBuf
6 6
7 import ( 7 import (
8 "bytes" 8 "bytes"
9 "sort" 9 "sort"
10 10
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 if distinct != nil { 228 if distinct != nil {
229 // NOTE: We know that toUse will not be used after this point for 229 // NOTE: We know that toUse will not be used after this point for
230 // comparison purposes, so re-use its cmpRow property fo r our distinct 230 // comparison purposes, so re-use its cmpRow property fo r our distinct
231 // filter here. 231 // filter here.
232 toUse.cmpRow = "" 232 toUse.cmpRow = ""
233 if !distinct.Add(toUse.getCmpRow(nil, nil, distinctOrder )) { 233 if !distinct.Add(toUse.getCmpRow(nil, nil, distinctOrder )) {
234 continue 234 continue
235 } 235 }
236 } 236 }
237 if err := cb(toUse.key, toUse.data); err != nil { 237 if err := cb(toUse.key, toUse.data); err != nil {
238 if err == ds.Stop {
239 return nil
240 }
241 return err 238 return err
242 } 239 }
243 } 240 }
244 241
245 return nil 242 return nil
246 } 243 }
247 244
248 // toComparableString computes the byte-sortable 'order' string for the given 245 // toComparableString computes the byte-sortable 'order' string for the given
249 // key/PropertyMap. 246 // key/PropertyMap.
250 // 247 //
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 } 289 }
293 if !foundOne { 290 if !foundOne {
294 return nil, nil 291 return nil, nil
295 } 292 }
296 } 293 }
297 if end != nil && bytes.Compare(soFar, end) >= 0 { 294 if end != nil && bytes.Compare(soFar, end) >= 0 {
298 return nil, nil 295 return nil, nil
299 } 296 }
300 return soFar, ps["__key__"][0] 297 return soFar, ps["__key__"][0]
301 } 298 }
OLDNEW
« no previous file with comments | « filter/dscache/ds.go ('k') | filter/txnBuf/state.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698