Skip to content

[Repo Assist] perf: use while! in tryTail inner loop, removing redundant mutable go flag#388

Draft
github-actions[bot] wants to merge 2 commits intomainfrom
repo-assist/perf-while-bang-tryTail-20260415-da41738ddc8a8560
Draft

[Repo Assist] perf: use while! in tryTail inner loop, removing redundant mutable go flag#388
github-actions[bot] wants to merge 2 commits intomainfrom
repo-assist/perf-while-bang-tryTail-20260415-da41738ddc8a8560

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

🤖 This is an automated pull request from Repo Assist, an AI assistant.

Summary

Converts the inner taskSeq loop in tryTail from the manual go-flag + initial-MoveNext pre-advance pattern to the idiomatic while! form.

Before

taskSeq {
    let mutable go = true
    let! step = e.MoveNextAsync()
    go <- step

    while go do
        yield e.Current
        let! step = e.MoveNextAsync()
        go <- step
}
|> Some

After

taskSeq {
    while! e.MoveNextAsync() do
        yield e.Current
}
|> Some

Context

This is part of a broader series (#382, #386) replacing the old manual pre-advance idiom with the idiomatic while! CE operator, which:

  • Removes one mutable go bool per function
  • Removes the initial let! step = e.MoveNextAsync(); go <- step before the loop
  • Unifies style across the module

Scope

Single-function change: tryTail. No public API or behaviour change.

Trade-offs

None. Identical semantics, verified by the full test suite.

Test Status

Build: 0 warnings, 0 errors (Release, Linux)
Fantomas: formatting check passes
Tests: 5093 passed, 2 skipped, 0 failed

Generated by 🌈 Repo Assist, see workflow run. Learn more.

Generated by 🌈 Repo Assist, see workflow run. Learn more.

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@97143ac59cb3a13ef2a77581f929f06719c7402a

… flag

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants