summaryrefslogtreecommitdiff
path: root/core/fxcrt/bytestring.cpp
diff options
context:
space:
mode:
authorRyan Harrison <rharrison@chromium.org>2018-01-04 14:43:27 -0500
committerChromium commit bot <commit-bot@chromium.org>2018-01-04 20:19:41 +0000
commitc560a8c11a6f8ee239e570db8c022ae0fd2a4db5 (patch)
tree0c16389f7e5c5e29c57a9c7f77dd062fa07d8640 /core/fxcrt/bytestring.cpp
parentdf0a749452d933e4f434e2a33112667f1880db34 (diff)
downloadpdfium-c560a8c11a6f8ee239e570db8c022ae0fd2a4db5.tar.xz
Convert usages of pdfium::Optional to Optional
Change-Id: I29769f78eaad10c6a8b79e27524336c4f330377e Reviewed-on: https://pdfium-review.googlesource.com/22258 Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'core/fxcrt/bytestring.cpp')
-rw-r--r--core/fxcrt/bytestring.cpp32
1 files changed, 15 insertions, 17 deletions
diff --git a/core/fxcrt/bytestring.cpp b/core/fxcrt/bytestring.cpp
index 4c4bd57393..3e4861ae60 100644
--- a/core/fxcrt/bytestring.cpp
+++ b/core/fxcrt/bytestring.cpp
@@ -549,46 +549,44 @@ size_t ByteString::Insert(size_t location, char ch) {
return new_length;
}
-pdfium::Optional<size_t> ByteString::Find(char ch, size_t start) const {
+Optional<size_t> ByteString::Find(char ch, size_t start) const {
if (!m_pData)
- return pdfium::Optional<size_t>();
+ return Optional<size_t>();
if (!IsValidIndex(start))
- return pdfium::Optional<size_t>();
+ return Optional<size_t>();
const char* pStr = static_cast<const char*>(
memchr(m_pData->m_String + start, ch, m_pData->m_nDataLength - start));
- return pStr ? pdfium::Optional<size_t>(
- static_cast<size_t>(pStr - m_pData->m_String))
- : pdfium::Optional<size_t>();
+ return pStr ? Optional<size_t>(static_cast<size_t>(pStr - m_pData->m_String))
+ : Optional<size_t>();
}
-pdfium::Optional<size_t> ByteString::Find(const ByteStringView& subStr,
- size_t start) const {
+Optional<size_t> ByteString::Find(const ByteStringView& subStr,
+ size_t start) const {
if (!m_pData)
- return pdfium::Optional<size_t>();
+ return Optional<size_t>();
if (!IsValidIndex(start))
- return pdfium::Optional<size_t>();
+ return Optional<size_t>();
const char* pStr =
FX_strstr(m_pData->m_String + start, m_pData->m_nDataLength - start,
subStr.unterminated_c_str(), subStr.GetLength());
- return pStr ? pdfium::Optional<size_t>(
- static_cast<size_t>(pStr - m_pData->m_String))
- : pdfium::Optional<size_t>();
+ return pStr ? Optional<size_t>(static_cast<size_t>(pStr - m_pData->m_String))
+ : Optional<size_t>();
}
-pdfium::Optional<size_t> ByteString::ReverseFind(char ch) const {
+Optional<size_t> ByteString::ReverseFind(char ch) const {
if (!m_pData)
- return pdfium::Optional<size_t>();
+ return Optional<size_t>();
size_t nLength = m_pData->m_nDataLength;
while (nLength--) {
if (m_pData->m_String[nLength] == ch)
- return pdfium::Optional<size_t>(nLength);
+ return Optional<size_t>(nLength);
}
- return pdfium::Optional<size_t>();
+ return Optional<size_t>();
}
void ByteString::MakeLower() {