(pg pq.Page)
| 889 | } |
| 890 | |
| 891 | func (c *SyncIterator) setPage(pg pq.Page) { |
| 892 | // Handle an outgoing page |
| 893 | if c.currPage != nil { |
| 894 | c.curr = c.currPageMax.Preceding() // Reposition current row number to end of this page. |
| 895 | pq.Release(c.currPage) |
| 896 | c.currPage = nil |
| 897 | } |
| 898 | |
| 899 | // Reset value buffers |
| 900 | c.currValues = nil |
| 901 | c.currPageMax = EmptyRowNumber() |
| 902 | c.currPageMin = EmptyRowNumber() |
| 903 | c.currBufN = 0 |
| 904 | c.currPageN = 0 |
| 905 | |
| 906 | // If we don't immediately have a new incoming page |
| 907 | // then return the buffer to the pool. |
| 908 | if pg == nil && c.currBuf != nil { |
| 909 | syncIteratorPoolPut(c.currBuf) |
| 910 | c.currBuf = nil |
| 911 | } |
| 912 | |
| 913 | // Handle an incoming page |
| 914 | if pg != nil { |
| 915 | rn := c.curr |
| 916 | rn.Skip(pg.NumRows() + 1) // Exclusive upper bound, points at the first rownumber in the next page |
| 917 | c.currPage = pg |
| 918 | c.currPageMin = c.curr |
| 919 | c.currPageMax = rn |
| 920 | c.currValues = pg.Values() |
| 921 | } |
| 922 | } |
| 923 | |
| 924 | func (c *SyncIterator) closeCurrRowGroup() { |
| 925 | if c.currChunk != nil { |
no test coverage detected