#Centipede NFC: use ByteSpan for the argument. PiperOrigin-RevId: 761522535
diff --git a/centipede/util.cc b/centipede/util.cc index 5cca4c5..c5e1b74 100644 --- a/centipede/util.cc +++ b/centipede/util.cc
@@ -65,7 +65,7 @@ std::hash<std::thread::id>{}(std::this_thread::get_id()); } -std::string AsPrintableString(const ByteArray &data, size_t max_len) { +std::string AsPrintableString(ByteSpan data, size_t max_len) { std::ostringstream out; size_t len = std::min(max_len, data.size()); for (size_t i = 0; i < len; ++i) {
diff --git a/centipede/util.h b/centipede/util.h index 5b02c41..1f31e40 100644 --- a/centipede/util.h +++ b/centipede/util.h
@@ -34,7 +34,7 @@ // being remote. Returns an empty string if the `file_path` is empty. std::string HashOfFileContents(std::string_view file_path); // Returns a printable string representing at most `max_len` bytes of `data`. -std::string AsPrintableString(const ByteArray &data, size_t max_len); +std::string AsPrintableString(ByteSpan data, size_t max_len); // Reads from a local file `file_path` into `data`. // Crashes on any error. void ReadFromLocalFile(std::string_view file_path, ByteArray &data);