Skip to content

Commit 85618f7

Browse files
authored
Merge pull request #18 from trimble-oss/lock_fix_pt2
Add less to the rlock.
2 parents 98bbbd3 + 163bbea commit 85618f7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

memory/table.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1587,13 +1587,15 @@ func (ps partitionssort) Len() int {
15871587
}
15881588

15891589
func (ps partitionssort) Less(i, j int) bool {
1590+
var less bool
15901591
ps.partitionMux.RLock()
15911592
lidx := ps.idx[i]
15921593
ridx := ps.idx[j]
15931594
lr := ps.ps[lidx.key][lidx.i]
15941595
rr := ps.ps[ridx.key][ridx.i]
1596+
less = ps.less(lr, rr)
15951597
ps.partitionMux.RUnlock()
1596-
return ps.less(lr, rr)
1598+
return less
15971599
}
15981600

15991601
func (ps partitionssort) Swap(i, j int) {

0 commit comments

Comments
 (0)