src: use if constexpr
where appropriate
#44291
Merged
if constexpr
where appropriate
#44291