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

Side by Side Diff: impl/memory/plist.go

Issue 1247283003: Improve docs (Closed) Base URL: https://github.com/luci/gae.git@reduce_size
Patch Set: fix comments Created 5 years, 5 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 | « impl/dummy/doc.go ('k') | impl/memory/raw_datastore_data.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 memory 5 package memory
6 6
7 import ( 7 import (
8 "bytes" 8 "bytes"
9 "fmt" 9 "fmt"
10 "sort" 10 "sort"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 66
67 buf := &bytes.Buffer{} 67 buf := &bytes.Buffer{}
68 ret = make(serializedIndexablePmap, len(pm)) 68 ret = make(serializedIndexablePmap, len(pm))
69 for k, vals := range pm { 69 for k, vals := range pm {
70 newVals := make(serializedPvals, 0, len(vals)) 70 newVals := make(serializedPvals, 0, len(vals))
71 for _, v := range vals { 71 for _, v := range vals {
72 if v.IndexSetting() == rds.NoIndex { 72 if v.IndexSetting() == rds.NoIndex {
73 continue 73 continue
74 } 74 }
75 buf.Reset() 75 buf.Reset()
76 » » » rds.WriteProperty(buf, v, rds.WithoutContext) 76 » » » v.Write(buf, rds.WithoutContext)
77 newVal := make([]byte, buf.Len()) 77 newVal := make([]byte, buf.Len())
78 copy(newVal, buf.Bytes()) 78 copy(newVal, buf.Bytes())
79 newVals = append(newVals, newVal) 79 newVals = append(newVals, newVal)
80 } 80 }
81 if len(newVals) > 0 { 81 if len(newVals) > 0 {
82 sort.Sort(newVals) 82 sort.Sort(newVals)
83 ret[k] = newVals 83 ret[k] = newVals
84 } 84 }
85 } 85 }
86 return 86 return
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 coll.Set(k, nv) 280 coll.Set(k, nv)
281 } 281 }
282 }) 282 })
283 default: 283 default:
284 panic("impossible") 284 panic("impossible")
285 } 285 }
286 // TODO(riannucci): remove entries from idxColl and remove index collections 286 // TODO(riannucci): remove entries from idxColl and remove index collections
287 // when there are no index entries for that index any more. 287 // when there are no index entries for that index any more.
288 }) 288 })
289 } 289 }
OLDNEW
« no previous file with comments | « impl/dummy/doc.go ('k') | impl/memory/raw_datastore_data.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698