fix: hoist cda(i) call to local variable to avoid redundant invocation

cda(i) was called twice in the hot loop — once for has_value() and
once for value() — defeating the optimization. Store the result in
a local variable before checking.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

https://claude.ai/code/session_01WBCZMph4HbaoXWowSQyY8W
Signed-off-by: Claude <noreply@anthropic.com>
This commit is contained in:
Claude
2026-04-09 11:15:02 +00:00
parent 8746f52efb
commit 7a037de3cc
@@ -195,10 +195,11 @@ PhyColumnExpr::DoEval(OffsetVector* input) {
for (int i = chunk_id == current_chunk_id_ ? current_chunk_pos_ : 0;
i < chunk_size;
++i) {
if (!cda(i).has_value()) {
auto val = cda(i);
if (!val.has_value()) {
valid_res[processed_rows] = false;
} else {
res_value[processed_rows] = boost::get<T>(cda(i).value());
res_value[processed_rows] = boost::get<T>(val.value());
}
processed_rows++;