diff options
author | Joel Rosdahl <joel@rosdahl.net> | 2022-10-05 21:02:36 +0200 |
---|---|---|
committer | Joel Rosdahl <joel@rosdahl.net> | 2022-10-05 21:36:17 +0200 |
commit | e9ddf6800eaed6ce45bcb01f976995ef423c6ae2 (patch) | |
tree | b9f1a9fa49a5e2f74dc0c9c79f115edcb7df2b43 /src/core | |
parent | 3decb4f2accfaba433fbfb9716a0c30792d7fc7b (diff) | |
download | ccache-e9ddf6800eaed6ce45bcb01f976995ef423c6ae2.tar.gz |
refactor: Store compiler output as bytes
As discussed in #1173.
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/Result.cpp | 4 | ||||
-rw-r--r-- | src/core/Result.hpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/core/Result.cpp b/src/core/Result.cpp index e1da6457..079923eb 100644 --- a/src/core/Result.cpp +++ b/src/core/Result.cpp @@ -235,11 +235,11 @@ Serializer::Serializer(const Config& config) } void -Serializer::add_data(const FileType file_type, std::string_view data) +Serializer::add_data(const FileType file_type, nonstd::span<const uint8_t> data) { m_serialized_size += 1 + 1 + 8; // marker + file_type + file_size m_serialized_size += data.size(); - m_file_entries.push_back(FileEntry{file_type, util::to_span(data)}); + m_file_entries.push_back(FileEntry{file_type, data}); } void diff --git a/src/core/Result.hpp b/src/core/Result.hpp index 970211f4..92301e16 100644 --- a/src/core/Result.hpp +++ b/src/core/Result.hpp @@ -139,7 +139,7 @@ public: // Register data to include in the result. The data must live until // serialize() has been called. - void add_data(FileType file_type, std::string_view data); + void add_data(FileType file_type, nonstd::span<const uint8_t> data); // Register a file path whose content should be included in the result. void add_file(FileType file_type, const std::string& path); |