Replace some fxcrt::spancpy() calls
Switch to fxcrt::Copy() for callers that do not need the spancpy()
return value.
Change-Id: I9ce342cc81b0069bdea53bfa24542801dab2e9ce
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/122935
Reviewed-by: Tom Sepez <tsepez@google.com>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/core/fxcrt/string_data_template.cpp b/core/fxcrt/string_data_template.cpp
index 30ca0a6..7152798 100644
--- a/core/fxcrt/string_data_template.cpp
+++ b/core/fxcrt/string_data_template.cpp
@@ -14,7 +14,7 @@
#include "core/fxcrt/check_op.h"
#include "core/fxcrt/fx_memory.h"
#include "core/fxcrt/fx_safe_types.h"
-#include "core/fxcrt/span_util.h"
+#include "core/fxcrt/stl_util.h"
namespace fxcrt {
@@ -63,14 +63,14 @@
template <typename CharType>
void StringDataTemplate<CharType>::CopyContents(
const StringDataTemplate& other) {
- fxcrt::spancpy(capacity_span(),
- other.capacity_span().first(other.m_nDataLength + 1));
+ fxcrt::Copy(other.capacity_span().first(other.m_nDataLength + 1),
+ capacity_span());
}
template <typename CharType>
void StringDataTemplate<CharType>::CopyContents(
pdfium::span<const CharType> str) {
- fxcrt::spancpy(capacity_span(), str);
+ fxcrt::Copy(str, capacity_span());
capacity_span()[str.size()] = 0;
}
@@ -78,7 +78,7 @@
void StringDataTemplate<CharType>::CopyContentsAt(
size_t offset,
pdfium::span<const CharType> str) {
- fxcrt::spancpy(capacity_span().subspan(offset), str);
+ fxcrt::Copy(str, capacity_span().subspan(offset));
capacity_span()[offset + str.size()] = 0;
}