← Back to Pull requests

regcomp.c: Nano optimization #24901

Merged
khwilliamson merged 1 files (4 lines) on Oct 05, 2026 21:13 UTC
View on GitHub
khwilliamson khwilliamson commented on Oct 04, 2026 21:37 UTC
Author

Maybe a compiler would see this and optimize it anyway. But here we call a macro and if it fails, try another one. But the first is guaranteed to fail if the input is > 255; and the second is guaranteed to fail otherwise. By explicitly testing beforehand what the input range is, we only call the appropriate macro.

  • This set of changes does not require a perldelta entry.
  • Diff: 4 lines (+1 / -3) across 1 files Reviewer: tonycoz Review duration: 1415m
    All Vouch review confidence checks passed
    Residual risk 0.03 = Change Risk (0.13) × (1 − Review Confidence (0.80)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.13 · 4 lines diff across 1 files
    0.13
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.71 · 1 substantive comment(s)
    0.71
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    79%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.096
    Real PR Conversation Timeline
    3 items
    tonycoz tonycoz commented on code on Oct 04, 2026 22:26 UTC
    Code Review
    regcomp.c:1
    @@ -10510,8 +10510,8 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth,
                     break;
                 }   /* End of switch on char following backslash */
             } /* end of handling backslash escape sequences */
    -        else if (   generic_isCC_(value, CC_VERTSPACE_)
    -                 || is_VERTWS_cp_high(value))
    +        else if ((value < 256) ? generic_isCC_(value, CC_VERTSPACE_)
    +                               : is_VERTWS_cp_high(value))

    Isn't this isVERTWS_uvchr(value) ?

    (saw the check, and thought "surely we have this?")

    tonycoz tonycoz approved these changes on Oct 05, 2026 21:00 UTC
    Approved Reviewer

    Approved these changes.

    Reviewers
    Assignees
    khwilliamson khwilliamson
    Labels
    risk: low confidence: 79.6% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 12.6% (LOW) · Higher = larger blast radius
    12.6%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 79.6% · Lower = rushed or shallow review
    79.6%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 2.6% · Safe to merge
    2.6%
    Repository