aboutsummaryrefslogtreecommitdiff
path: root/format/commitgraph/read/iterators.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-04-02 06:23:30 +0000
committerGravatar Runxi Yu2026-04-02 06:28:39 +0000
commita041d523de389b65b98a5373a8034041db2a8d83 (patch)
tree7b423dc735f463be616045f2c3c2095a7737aca7 /format/commitgraph/read/iterators.go
parentresearch: Add dynamic pack resources (diff)
signatureNo signature
*: Remove
Diffstat (limited to 'format/commitgraph/read/iterators.go')
-rw-r--r--format/commitgraph/read/iterators.go49
1 files changed, 0 insertions, 49 deletions
diff --git a/format/commitgraph/read/iterators.go b/format/commitgraph/read/iterators.go
deleted file mode 100644
index 0e31f7e5..00000000
--- a/format/commitgraph/read/iterators.go
+++ /dev/null
@@ -1,49 +0,0 @@
-package read
-
-import (
- "iter"
-
- "codeberg.org/lindenii/furgit/internal/intconv"
- objectid "codeberg.org/lindenii/furgit/object/id"
-)
-
-// AllPositions iterates all commit positions in native layer order.
-//
-// Labels: Life-Parent.
-func (reader *Reader) AllPositions() iter.Seq[Position] {
- return func(yield func(Position) bool) {
- for layerIdx := range reader.layers {
- layer := &reader.layers[layerIdx]
-
- graph, err := intconv.IntToUint32(layerIdx)
- if err != nil {
- return
- }
-
- for idx := range layer.numCommits {
- if !yield(Position{Graph: graph, Index: idx}) {
- return
- }
- }
- }
- }
-}
-
-// AllOIDs iterates all commit object IDs in native layer order.
-//
-// Labels: Life-Parent.
-func (reader *Reader) AllOIDs() iter.Seq[objectid.ObjectID] {
- return func(yield func(objectid.ObjectID) bool) {
- positions := reader.AllPositions()
- for pos := range positions {
- oid, err := reader.OIDAt(pos)
- if err != nil {
- return
- }
-
- if !yield(oid) {
- return
- }
- }
- }
-}