Skip to content

Commit fd131df

Browse files
fixup! switch to using std::optional
1 parent 2a69d25 commit fd131df

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lldb/source/DataFormatters/FormattersHelpers.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,7 @@ lldb_private::formatters::ExtractIndexFromString(const char *item_name) {
106106
item_name++;
107107
char *endptr = nullptr;
108108
unsigned long int idx = ::strtoul(item_name, &endptr, 0);
109-
if (idx == 0 && endptr == item_name)
110-
return std::nullopt;
111-
if (idx == ULONG_MAX)
109+
if ((idx == 0 && endptr == item_name) || idx == ULONG_MAX)
112110
return std::nullopt;
113111
return idx;
114112
}

0 commit comments

Comments
 (0)