From 0f66be50dd68be8a42dc6fe07b023784789249b9 Mon Sep 17 00:00:00 2001 From: klzgrad Date: Sat, 23 Mar 2019 20:26:57 +0800 Subject: [PATCH] naive: Replace arraysize with base::size --- src/net/tools/naive/socks5_server_socket.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/net/tools/naive/socks5_server_socket.cc b/src/net/tools/naive/socks5_server_socket.cc index 65643958a1..bd6f1a9929 100644 --- a/src/net/tools/naive/socks5_server_socket.cc +++ b/src/net/tools/naive/socks5_server_socket.cc @@ -12,6 +12,7 @@ #include "base/bind_helpers.h" #include "base/callback_helpers.h" #include "base/logging.h" +#include "base/stl_util.h" #include "base/sys_byteorder.h" #include "net/base/ip_address.h" #include "net/base/net_errors.h" @@ -340,7 +341,7 @@ int Socks5ServerSocket::DoGreetReadComplete(int result) { int Socks5ServerSocket::DoGreetWrite() { if (buffer_.empty()) { const char write_data[] = {kSOCKS5Version, auth_method_}; - buffer_ = std::string(write_data, arraysize(write_data)); + buffer_ = std::string(write_data, base::size(write_data)); bytes_sent_ = 0; } @@ -498,7 +499,7 @@ int Socks5ServerSocket::DoHandshakeWrite() { 0x00, 0x00, // BND.PORT }; - buffer_ = std::string(write_data, arraysize(write_data)); + buffer_ = std::string(write_data, base::size(write_data)); bytes_sent_ = 0; }