Revise ternary operators

Where test expression is already or almost boolean type, using ternery
operator is excessive and possibly more difficult to read.

Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
Simon Rozman 2025-05-27 10:22:07 +02:00
parent bed22e7fa5
commit 496dc9cb34
2 changed files with 5 additions and 5 deletions

View File

@ -875,7 +875,7 @@ namespace stdex
{
stdex_assert(text || start >= end);
const wchar_t* str = m_str.data();
const bool case_insensitive = flags & match_case_insensitive ? true : false;
const bool case_insensitive = (flags & match_case_insensitive) != 0;
const auto& ctype = std::use_facet<std::ctype<wchar_t>>(m_locale);
for (this->interval.end = start;;) {
if (!*str) {
@ -4670,7 +4670,7 @@ namespace stdex
{
stdex_assert(text || start >= end);
const auto& ctype = std::use_facet<std::ctype<T>>(this->m_locale);
const bool case_insensitive = flags & match_case_insensitive ? true : false;
const bool case_insensitive = (flags & match_case_insensitive) != 0;
struct country_t {
T country[2];
T check_digits[2];
@ -4956,7 +4956,7 @@ namespace stdex
{
stdex_assert(text || start >= end);
const auto& ctype = std::use_facet<std::ctype<T>>(this->m_locale);
const bool case_insensitive = flags & match_case_insensitive ? true : false;
const bool case_insensitive = (flags & match_case_insensitive) != 0;
size_t n, available, next;
uint32_t nominator;
@ -5196,7 +5196,7 @@ namespace stdex
{
stdex_assert(text || start >= end);
const auto& ctype = std::use_facet<std::ctype<T>>(this->m_locale);
const bool case_insensitive = flags & match_case_insensitive ? true : false;
const bool case_insensitive = (flags & match_case_insensitive) != 0;
this->interval.end = start;
if (this->interval.end >= end || this->interval.end + 1 >= end ||

View File

@ -2764,7 +2764,7 @@ namespace stdex
if (mode & share_deleting) dwShareMode |= FILE_SHARE_DELETE;
SECURITY_ATTRIBUTES sa = { sizeof(SECURITY_ATTRIBUTES) };
sa.bInheritHandle = mode & inherit_handle ? true : false;
sa.bInheritHandle = mode & inherit_handle ? TRUE : FALSE;
DWORD dwCreationDisposition;
switch (mode & mode_disposition_mask) {