(pgidstack []common.Pgid, fn func(*common.Page, int, []common.Pgid))
| 649 | } |
| 650 | |
| 651 | func (tx *Tx) forEachPageInternal(pgidstack []common.Pgid, fn func(*common.Page, int, []common.Pgid)) { |
| 652 | p := tx.page(pgidstack[len(pgidstack)-1]) |
| 653 | |
| 654 | // Execute function. |
| 655 | fn(p, len(pgidstack)-1, pgidstack) |
| 656 | |
| 657 | // Recursively loop over children. |
| 658 | if p.IsBranchPage() { |
| 659 | for i := 0; i < int(p.Count()); i++ { |
| 660 | elem := p.BranchPageElement(uint16(i)) |
| 661 | tx.forEachPageInternal(append(pgidstack, elem.Pgid()), fn) |
| 662 | } |
| 663 | } |
| 664 | } |
| 665 | |
| 666 | // Page returns page information for a given page number. |
| 667 | // This is only safe for concurrent use when used by a writable transaction. |
no test coverage detected