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

Unified Diff: impl/memory/datastore_index.go

Issue 1312433013: Switch to external stringset implementation. (Closed) Base URL: https://github.com/luci/gae.git@master
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
« no previous file with comments | « no previous file | impl/memory/datastore_index_selection.go » ('j') | impl/memory/datastore_index_selection.go » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: impl/memory/datastore_index.go
diff --git a/impl/memory/datastore_index.go b/impl/memory/datastore_index.go
index f4db119e6bd8af872caa037749419d62181a2e38..f3c12d1b5523f60c333d55e5e57bb6c1b134ed0b 100644
--- a/impl/memory/datastore_index.go
+++ b/impl/memory/datastore_index.go
@@ -12,6 +12,7 @@ import (
ds "github.com/luci/gae/service/datastore"
"github.com/luci/gae/service/datastore/serialize"
"github.com/luci/gkvlite"
+ "github.com/luci/luci-go/common/stringset"
)
type qIndexSlice []*ds.IndexDefinition
@@ -68,7 +69,7 @@ func partiallySerialize(k ds.Key, pm ds.PropertyMap) (ret serializedIndexablePma
k = k.Parent()
}
for k, vals := range pm {
- dups := stringSet{}
+ dups := stringset.New(0)
newVals := make(serializedPvals, 0, len(vals))
for _, v := range vals {
if v.IndexSetting() == ds.NoIndex {
@@ -76,7 +77,7 @@ func partiallySerialize(k ds.Key, pm ds.PropertyMap) (ret serializedIndexablePma
}
data := serialize.ToBytes(v)
dataS := string(data)
- if !dups.add(dataS) {
+ if !dups.Add(dataS) {
continue
}
newVals = append(newVals, data)
« no previous file with comments | « no previous file | impl/memory/datastore_index_selection.go » ('j') | impl/memory/datastore_index_selection.go » ('J')

Powered by Google App Engine
This is Rietveld 408576698