From d105619bc32295d1b4290b054ab0c2b7be0d4874 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Mon, 15 Oct 2018 23:46:33 +0900 Subject: [PATCH] src: Remove extra braces if possible --- src/memchunk_test.cc | 16 ++++++++-------- src/shrpx_api_downstream_connection.cc | 4 ++-- src/shrpx_client_handler.cc | 2 +- src/shrpx_signal.cc | 6 +++--- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/memchunk_test.cc b/src/memchunk_test.cc index 41854b7c..fe0a892c 100644 --- a/src/memchunk_test.cc +++ b/src/memchunk_test.cc @@ -224,10 +224,10 @@ void test_peek_memchunks_append(void) { MemchunkPool16 pool; PeekMemchunks16 pchunks(&pool); - std::array b{{ + std::array b{ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '1', - }}, + }, d; pchunks.append(b.data(), b.size()); @@ -259,10 +259,10 @@ void test_peek_memchunks_disable_peek_drain(void) { MemchunkPool16 pool; PeekMemchunks16 pchunks(&pool); - std::array b{{ + std::array b{ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '1', - }}, + }, d; pchunks.append(b.data(), b.size()); @@ -287,10 +287,10 @@ void test_peek_memchunks_disable_peek_no_drain(void) { MemchunkPool16 pool; PeekMemchunks16 pchunks(&pool); - std::array b{{ + std::array b{ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '1', - }}, + }, d; pchunks.append(b.data(), b.size()); @@ -315,10 +315,10 @@ void test_peek_memchunks_reset(void) { MemchunkPool16 pool; PeekMemchunks16 pchunks(&pool); - std::array b{{ + std::array b{ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '1', - }}, + }, d; pchunks.append(b.data(), b.size()); diff --git a/src/shrpx_api_downstream_connection.cc b/src/shrpx_api_downstream_connection.cc index c45f92bd..4fa7dc21 100644 --- a/src/shrpx_api_downstream_connection.cc +++ b/src/shrpx_api_downstream_connection.cc @@ -41,7 +41,7 @@ namespace shrpx { namespace { // List of API endpoints const std::array &apis() { - static const auto apis = new std::array{{ + static const auto apis = new std::array{ APIEndpoint{ StringRef::from_lit("/api/v1beta1/backendconfig"), true, @@ -54,7 +54,7 @@ const std::array &apis() { (1 << API_METHOD_GET), &APIDownstreamConnection::handle_configrevision, }, - }}; + }; return *apis; } diff --git a/src/shrpx_client_handler.cc b/src/shrpx_client_handler.cc index 63cf4f28..f1605302 100644 --- a/src/shrpx_client_handler.cc +++ b/src/shrpx_client_handler.cc @@ -1319,7 +1319,7 @@ int ClientHandler::proxy_protocol_read() { // NULL character really destroys functions which expects NULL // terminated string. We won't expect it in PROXY protocol line, so // find it here. - auto chrs = std::array{{'\n', '\0'}}; + auto chrs = std::array{'\n', '\0'}; constexpr size_t MAX_PROXY_LINELEN = 107; diff --git a/src/shrpx_signal.cc b/src/shrpx_signal.cc index 5e16bf3c..5070d167 100644 --- a/src/shrpx_signal.cc +++ b/src/shrpx_signal.cc @@ -110,13 +110,13 @@ int signal_set_handler(void (*handler)(int), Signals &&sigs) { } // namespace namespace { -constexpr auto master_proc_ign_signals = std::array{{SIGPIPE}}; +constexpr auto master_proc_ign_signals = std::array{SIGPIPE}; } // namespace namespace { constexpr auto worker_proc_ign_signals = - std::array{{REOPEN_LOG_SIGNAL, EXEC_BINARY_SIGNAL, - GRACEFUL_SHUTDOWN_SIGNAL, RELOAD_SIGNAL, SIGPIPE}}; + std::array{REOPEN_LOG_SIGNAL, EXEC_BINARY_SIGNAL, + GRACEFUL_SHUTDOWN_SIGNAL, RELOAD_SIGNAL, SIGPIPE}; } // namespace int shrpx_signal_set_master_proc_ign_handler() {