summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcin Kowalczyk <qrczak@google.com>2022-10-08 21:41:20 +0200
committerqrczak <qrczak@google.com>2022-10-08 21:59:12 +0200
commit984b191f0fefdeb17050b42a90b7625999c13b8d (patch)
tree49905ebf25778a599577324a77fe78527c32b51c
parent974fcc49e8b6892ab9c42e2bf69ca1eb61f4e4c7 (diff)
downloadsnappy-git-984b191f0fefdeb17050b42a90b7625999c13b8d.tar.gz
Fix the remaining occurrence of non-const `std::string::data()`.
PiperOrigin-RevId: 479818960
-rw-r--r--snappy_unittest.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/snappy_unittest.cc b/snappy_unittest.cc
index 122be0c..e57b13d 100644
--- a/snappy_unittest.cc
+++ b/snappy_unittest.cc
@@ -568,7 +568,7 @@ TEST(Snappy, IOVecSourceEdgeCases) {
// Validate that empty leading, trailing, and in-between iovecs are handled:
// [] [] ['a'] [] ['b'] [].
std::string data = "ab";
- char* buf = data.data();
+ char* buf = const_cast<char*>(data.data());
size_t used_so_far = 0;
static const int kLengths[] = {0, 0, 1, 0, 1, 0};
struct iovec iov[ARRAYSIZE(kLengths)];