diff options
| author | 2026-03-29 13:38:19 +0000 | |
|---|---|---|
| committer | 2026-03-29 13:39:49 +0000 | |
| commit | 37707aada0157f255dbad920b917efb601184e12 (patch) | |
| tree | 29f79d242c764de8d6f1e65bcc847e53f21cd646 /commitquery/paint.go | |
| parent | commitquery: Context has been gone long ago (diff) | |
| signature | No signature | |
commitquery: Reorganize
Diffstat (limited to 'commitquery/paint.go')
| -rw-r--r-- | commitquery/paint.go | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/commitquery/paint.go b/commitquery/paint.go deleted file mode 100644 index 6bb1f489..00000000 --- a/commitquery/paint.go +++ /dev/null @@ -1,55 +0,0 @@ -package commitquery - -func (query *query) paintDownToCommon(left nodeIndex, rights []nodeIndex, minGeneration uint64) error { - query.beginMarkPhase() - - query.setMarks(left, markLeft) - - if len(rights) == 0 { - query.setMarks(left, markResult) - - return nil - } - - queue := newPriorityQueue(query) - queue.PushNode(left) - - for _, right := range rights { - query.setMarks(right, markRight) - queue.PushNode(right) - } - - lastGeneration := generationInfinity - - for query.queueHasNonStale(queue) { - idx := queue.PopNode() - - generation := query.effectiveGeneration(idx) - if generation > lastGeneration { - return errBadGenerationOrder - } - - lastGeneration = generation - if generation < minGeneration { - break - } - - flags := query.marks(idx) & (markLeft | markRight | markStale) - if flags == (markLeft | markRight) { - query.setMarks(idx, markResult) - - flags |= markStale - } - - for _, parent := range query.parents(idx) { - if query.hasAllMarks(parent, flags) { - continue - } - - query.setMarks(parent, flags) - queue.PushNode(parent) - } - } - - return nil -} |
