Skip to content

Commit 46a233d

Browse files
committed
code review fixes
1 parent 2f7b765 commit 46a233d

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

front.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -377,32 +377,32 @@ func (m sortedFronts) Less(i, j int) bool {
377377
}
378378
}
379379

380-
func (m sortedFronts) sortedCopy() sortedFronts {
381-
c := make(sortedFronts, len(m))
380+
func (m *sortedFronts) sortedCopy() sortedFronts {
381+
c := make(sortedFronts, len(*m))
382382
frontsMu.Lock()
383383
defer frontsMu.Unlock()
384-
copy(c, m)
384+
copy(c, *m)
385385
sort.Sort(c)
386386
return c
387387
}
388388

389-
func (m sortedFronts) addFronts(fronts sortedFronts) {
389+
func (m *sortedFronts) addFronts(fronts sortedFronts) {
390390
// Add new masquerades to the existing masquerades slice, but add them at the beginning.
391391
frontsMu.Lock()
392392
defer frontsMu.Unlock()
393-
m = append(m, fronts...)
393+
*m = append(fronts, *m...)
394394
}
395395

396-
func (m sortedFronts) size() int {
396+
func (m *sortedFronts) size() int {
397397
frontsMu.Lock()
398398
defer frontsMu.Unlock()
399-
return len(m)
399+
return len(*m)
400400
}
401401

402-
func (m sortedFronts) frontAt(i int) Front {
402+
func (m *sortedFronts) frontAt(i int) Front {
403403
frontsMu.Lock()
404404
defer frontsMu.Unlock()
405-
return m[i]
405+
return (*m)[i]
406406
}
407407

408408
func (fr *front) markCacheDirty() {

0 commit comments

Comments
 (0)