- commit
- ef8c0a76996d61c62cc02cba9cc74975c9161495
- parent
- cf897e2efff656c63f87d94eafe493953160d368
- author
- Dami <dami.etoile@gmail.com>
| M | internal/ | 6 | +++--- |
@@ -100,11 +100,11 @@ func (st *cellStore) inRange(r Rect) iter.Seq2[Addr, *Cell] {
100100 101101 // anyInRange yields the stored cells in r in no particular order,102102 // visiting whichever is cheaper: the index, row by row, or every stored103-// cell (iterating the map costs a fraction of a lookup per cell) when r104-// is as large as the sheet's cells are many.103+// cell (iterating the map costs a quarter of a lookup per cell) when r104+// is more than a quarter as large as the sheet's cells are many.105105 func (st *cellStore) anyInRange(r Rect) iter.Seq2[Addr, *Cell] {106106 area := (r.To.Col - r.From.Col + 1) * (r.To.Row - r.From.Row + 1)107- if area < len(st.m) {107+ if area <= len(st.m)/4 {108108 return st.inRange(r)109109 }110110 return func(yield func(Addr, *Cell) bool) {