- Type: Correctness risk / Maintainability
- Severity: Low
- Component: Non-local BC spherical mapping
- Location:
Src/Base/AMReX_NonLocalBCImpl.H:890
Problem
The branch condition is written as:
else if (imd && jmd & klo)
jmd and klo are booleans. Using bitwise & here is likely a typo from manual editing and is inconsistent with neighboring conditions that use &&.
Impact
- Harder to read and easier to misinterpret in future edits.
- No short-circuit semantics on the
jmd & klo subexpression.
- Increases risk of future copy-paste logic mistakes in this already branch-heavy routine.
Suggested patch
--- a/Src/Base/AMReX_NonLocalBCImpl.H
+++ b/Src/Base/AMReX_NonLocalBCImpl.H
@@
- else if (imd && jmd & klo)
+ else if (imd && jmd && klo)
Prepared by Codex