diff --git a/lfs.c b/lfs.c index 964ddf3a..b8069a91 100644 --- a/lfs.c +++ b/lfs.c @@ -2935,6 +2935,13 @@ trunk:; } // do bounds want to take different paths? begin diverging + // >b | nb => nb | + // .----'| .--------|--' .-----------' | + // b + // .----'| .-'| + // | | | + // | .-'| .-----|--' + // 1 2 3 1 2 3 x if (diverging && diverging_red) { LFS_ASSERT(a_rid < b_rid || a_tag < b_tag); LFS_ASSERT(lfsr_tag_isparallel(alt, p[0].alt)); @@ -2966,6 +2978,13 @@ trunk:; } // diverging upper? stitch together both trunks + // >b nb | + // .--------|--' .-----------' | + // | b_rid || a_tag > b_tag) { lfsr_tag_trim2( alt, weight, @@ -2986,9 +3005,13 @@ trunk:; branch = branch_; continue; } - - // trim diverging alts so they can be pruned + // diverged? + // : : + // nb + // .-'| .--' + // 3 4 3 4 x } else if (diverged && diverging) { + // trim so alt is pruned lfsr_tag_trim( alt, weight, &lower_rid, &upper_rid, @@ -2997,15 +3020,19 @@ trunk:; } // prune? + // + // note if only yellow pruning this could be much simpler + + // prune unreachable red alts // b // .-'| .-'| // | | >b + // | .----' | .--------|-'| + // | | b + // .-'| .-'| + // | | | + // | .----' | | | | + // | | nb + // .-'| .--' + // 3 4 3 4 x } else { alt = LFSR_TAG_ALT(LFSR_TAG_LE, LFSR_TAG_B, 0); weight = 0;