Skip to content

Commit

Permalink
refactor: branch with constant condition changed to if constexpr
Browse files Browse the repository at this point in the history
  • Loading branch information
mpusz committed Feb 15, 2025
1 parent a6c8130 commit 8eef111
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/include/mp-units/framework/unit.h
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,7 @@ constexpr Out unit_symbol_impl(Out out, const type_list<Nums...>& nums, const ty
if (fmt.solidus == always || (fmt.solidus == one_denominator && sizeof...(Dens) == 1)) {
if constexpr (sizeof...(Nums) == 0) *out++ = '1';
*out++ = '/';
if (sizeof...(Dens) > 1) *out++ = '(';
if constexpr (sizeof...(Dens) > 1) *out++ = '(';
} else if constexpr (sizeof...(Nums) > 0) {
out = print_separator<CharT>(out, fmt);
}
Expand Down

0 comments on commit 8eef111

Please sign in to comment.