Skip to content

Commit 6e79166

Browse files
committed
Saved a line :)
1 parent 95d6ee6 commit 6e79166

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

flang-rt/lib/runtime/character.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,9 +299,8 @@ inline RT_API_ATTRS std::size_t Index(const CHAR *x, std::size_t xLen,
299299
// We can use simple forward search.
300300
CHAR ch{want[0]};
301301
if constexpr (std::is_same_v<CHAR, char>) {
302-
auto pos{reinterpret_cast<const CHAR *>(
303-
Fortran::runtime::memchr(x, ch, xLen))};
304-
if (pos) {
302+
if (auto pos{reinterpret_cast<const CHAR *>(
303+
Fortran::runtime::memchr(x, ch, xLen))}) {
305304
return pos - x + 1;
306305
}
307306
} else {

0 commit comments

Comments
 (0)