Migrate ABSL_ARRAYSIZE()/arraysize() to std::size() where possible
Tested:
http://test/OCL:954251571:BASE:954243952:1785104448302:f138d139
Some test failures are present; the CL author decided to mail
PiperOrigin-RevId: 954409686
diff --git a/quiche/quic/core/qpack/qpack_send_stream.cc b/quiche/quic/core/qpack/qpack_send_stream.cc
index 9616c1a..d310d06 100644
--- a/quiche/quic/core/qpack/qpack_send_stream.cc
+++ b/quiche/quic/core/qpack/qpack_send_stream.cc
@@ -4,6 +4,8 @@
#include "quiche/quic/core/qpack/qpack_send_stream.h"
+#include <iterator>
+
#include "absl/base/macros.h"
#include "absl/strings/string_view.h"
#include "quiche/quic/core/quic_session.h"
@@ -40,7 +42,7 @@
void QpackSendStream::MaybeSendStreamType() {
if (!stream_type_sent_) {
char type[sizeof(http3_stream_type_)];
- QuicDataWriter writer(ABSL_ARRAYSIZE(type), type);
+ QuicDataWriter writer(std::size(type), type);
writer.WriteVarInt62(http3_stream_type_);
WriteOrBufferData(absl::string_view(writer.data(), writer.length()), false,
nullptr);
diff --git a/quiche/quic/core/qpack/qpack_static_table.cc b/quiche/quic/core/qpack/qpack_static_table.cc
index b057201..639145b 100644
--- a/quiche/quic/core/qpack/qpack_static_table.cc
+++ b/quiche/quic/core/qpack/qpack_static_table.cc
@@ -4,6 +4,7 @@
#include "quiche/quic/core/qpack/qpack_static_table.h"
+#include <iterator>
#include <vector>
#include "absl/base/macros.h"
@@ -14,7 +15,7 @@
// The "constructor" for a QpackStaticEntry that computes the lengths at
// compile time.
#define STATIC_ENTRY(name, value) \
- { name, ABSL_ARRAYSIZE(name) - 1, value, ABSL_ARRAYSIZE(value) - 1 }
+ {name, std::size(name) - 1, value, std::size(value) - 1}
const std::vector<QpackStaticEntry>& QpackStaticTableVector() {
static const auto* kQpackStaticTable = new std::vector<QpackStaticEntry>{