summaryrefslogtreecommitdiff
path: root/core/fxcrt/widestring.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcrt/widestring.h')
-rw-r--r--core/fxcrt/widestring.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/core/fxcrt/widestring.h b/core/fxcrt/widestring.h
index b668b0292c..4b097c4430 100644
--- a/core/fxcrt/widestring.h
+++ b/core/fxcrt/widestring.h
@@ -82,9 +82,8 @@ class WideString {
// Explicit conversion to span.
// Note: Any subsequent modification of |this| will invalidate the result.
pdfium::span<const wchar_t> AsSpan() const {
- return m_pData ? pdfium::span<const wchar_t>(m_pData->m_String,
- m_pData->m_nDataLength)
- : pdfium::span<const wchar_t>();
+ return pdfium::make_span(m_pData ? m_pData->m_String : nullptr,
+ GetLength());
}
// Note: Any subsequent modification of |this| will invalidate iterators.