mirror of
https://github.com/milvus-io/milvus.git
synced 2026-07-21 10:15:43 +00:00
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:
@@ -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++;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user