diff options
Diffstat (limited to 'format/commitgraph/edges.go')
| -rw-r--r-- | format/commitgraph/edges.go | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/format/commitgraph/edges.go b/format/commitgraph/edges.go deleted file mode 100644 index 277735d0..00000000 --- a/format/commitgraph/edges.go +++ /dev/null @@ -1,47 +0,0 @@ -package commitgraph - -import ( - "encoding/binary" - - "codeberg.org/lindenii/furgit/internal/intconv" -) - -func (reader *Reader) decodeExtraEdgeList(layer *layer, edgeStart uint32) ([]Position, error) { - if len(layer.chunkExtraEdges) == 0 { - return nil, &ErrMalformed{Path: layer.path, Reason: "missing EDGE chunk"} - } - - out := make([]Position, 0) - - cur := edgeStart - for { - off64 := uint64(cur) * 4 - - off, err := intconv.Uint64ToInt(off64) - if err != nil { - return nil, err - } - - if off+4 > len(layer.chunkExtraEdges) { - return nil, &ErrMalformed{Path: layer.path, Reason: "EDGE index out of range"} - } - - word := binary.BigEndian.Uint32(layer.chunkExtraEdges[off : off+4]) - parentGlobal := word & parentLastMask - - parentPos, err := reader.globalToPosition(parentGlobal) - if err != nil { - return nil, err - } - - out = append(out, parentPos) - - if word&parentExtraMask != 0 { - break - } - - cur++ - } - - return out, nil -} |
