sortTables sorts tables of levelHandler based on table.Smallest. Normally it should be called after all addTable calls.
()
| 157 | // sortTables sorts tables of levelHandler based on table.Smallest. |
| 158 | // Normally it should be called after all addTable calls. |
| 159 | func (s *levelHandler) sortTables() { |
| 160 | s.RLock() |
| 161 | defer s.RUnlock() |
| 162 | |
| 163 | sort.Slice(s.tables, func(i, j int) bool { |
| 164 | return y.CompareKeys(s.tables[i].Smallest(), s.tables[j].Smallest()) < 0 |
| 165 | }) |
| 166 | } |
| 167 | |
| 168 | func decrRefs(tables []*table.Table) error { |
| 169 | for _, table := range tables { |
no test coverage detected