Return absl::nullopt in StringViewTemplate.
Instead of returning Optional<T>(). Make it more obvious what the return
value is.
Change-Id: If988c509c9ea1b5f184bb120e3cf70186093bd2b
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/85516
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/core/fxcrt/string_view_template.h b/core/fxcrt/string_view_template.h
index b8a1eb5..dd7383c 100644
--- a/core/fxcrt/string_view_template.h
+++ b/core/fxcrt/string_view_template.h
@@ -193,7 +193,7 @@
const auto* found = reinterpret_cast<const UnsignedType*>(FXSYS_chr(
reinterpret_cast<const CharType*>(m_Span.data()), ch, m_Span.size()));
- return found ? Optional<size_t>(found - m_Span.data()) : Optional<size_t>();
+ return found ? Optional<size_t>(found - m_Span.data()) : absl::nullopt;
}
bool Contains(CharType ch) const { return Find(ch).has_value(); }