mirror of
https://github.com/nghttp2/nghttp2.git
synced 2025-12-08 11:08:52 +08:00
src: Remove empty parameter list from lambda
This commit is contained in:
@@ -3241,7 +3241,7 @@ int main(int argc, char **argv) {
|
|||||||
nclients, rate, max_samples_per_thread));
|
nclients, rate, max_samples_per_thread));
|
||||||
auto &worker = workers.back();
|
auto &worker = workers.back();
|
||||||
futures.push_back(
|
futures.push_back(
|
||||||
std::async(std::launch::async, [&worker, &mu, &cv, &ready]() {
|
std::async(std::launch::async, [&worker, &mu, &cv, &ready] {
|
||||||
{
|
{
|
||||||
std::unique_lock<std::mutex> ulk(mu);
|
std::unique_lock<std::mutex> ulk(mu);
|
||||||
cv.wait(ulk, [&ready] { return ready; });
|
cv.wait(ulk, [&ready] { return ready; });
|
||||||
|
|||||||
@@ -352,7 +352,7 @@ void ConnectionHandler::graceful_shutdown_worker() {
|
|||||||
#ifndef NOTHREADS
|
#ifndef NOTHREADS
|
||||||
ev_async_start(loop_, &thread_join_asyncev_);
|
ev_async_start(loop_, &thread_join_asyncev_);
|
||||||
|
|
||||||
thread_join_fut_ = std::async(std::launch::async, [this]() {
|
thread_join_fut_ = std::async(std::launch::async, [this] {
|
||||||
(void)reopen_log_files(get_config()->logging);
|
(void)reopen_log_files(get_config()->logging);
|
||||||
join_worker();
|
join_worker();
|
||||||
ev_async_send(get_loop(), &thread_join_asyncev_);
|
ev_async_send(get_loop(), &thread_join_asyncev_);
|
||||||
|
|||||||
@@ -400,7 +400,7 @@ select_quic_keying_material(const QUICKeyingMaterials &qkms, uint8_t km_id) {
|
|||||||
|
|
||||||
std::span<uint64_t, 2> generate_siphash_key() {
|
std::span<uint64_t, 2> generate_siphash_key() {
|
||||||
// Use the same technique rust does.
|
// Use the same technique rust does.
|
||||||
thread_local static auto key = []() {
|
thread_local static auto key = [] {
|
||||||
std::array<uint64_t, 2> key;
|
std::array<uint64_t, 2> key;
|
||||||
|
|
||||||
auto s = as_writable_uint8_span(std::span{key});
|
auto s = as_writable_uint8_span(std::span{key});
|
||||||
|
|||||||
@@ -367,7 +367,7 @@ void Worker::replace_downstream_config(
|
|||||||
|
|
||||||
for (auto &addr : shared_addr->addrs) {
|
for (auto &addr : shared_addr->addrs) {
|
||||||
addr.connect_blocker = std::make_unique<ConnectBlocker>(
|
addr.connect_blocker = std::make_unique<ConnectBlocker>(
|
||||||
randgen_, loop_, nullptr, [shared_addr_ptr, &addr]() {
|
randgen_, loop_, nullptr, [shared_addr_ptr, &addr] {
|
||||||
if (!addr.queued) {
|
if (!addr.queued) {
|
||||||
if (!addr.wg) {
|
if (!addr.wg) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
10
src/util.h
10
src/util.h
@@ -219,7 +219,7 @@ constexpr bool in_attr_char(char c) noexcept {
|
|||||||
return in_attr_char_tbl[static_cast<uint8_t>(c)];
|
return in_attr_char_tbl[static_cast<uint8_t>(c)];
|
||||||
}
|
}
|
||||||
|
|
||||||
inline constexpr auto hex_to_uint_tbl = []() {
|
inline constexpr auto hex_to_uint_tbl = [] {
|
||||||
std::array<uint32_t, 256> tbl;
|
std::array<uint32_t, 256> tbl;
|
||||||
|
|
||||||
std::ranges::fill(tbl, 256);
|
std::ranges::fill(tbl, 256);
|
||||||
@@ -601,7 +601,7 @@ time_t parse_http_date(const std::string_view &s);
|
|||||||
// ASN1_TIME_print().
|
// ASN1_TIME_print().
|
||||||
time_t parse_openssl_asn1_time_print(const std::string_view &s);
|
time_t parse_openssl_asn1_time_print(const std::string_view &s);
|
||||||
|
|
||||||
inline constexpr auto upcase_tbl = []() {
|
inline constexpr auto upcase_tbl = [] {
|
||||||
std::array<char, 256> tbl;
|
std::array<char, 256> tbl;
|
||||||
|
|
||||||
for (size_t i = 0; i < 256; ++i) {
|
for (size_t i = 0; i < 256; ++i) {
|
||||||
@@ -723,7 +723,7 @@ constexpr O tolower(R &&r, O result) {
|
|||||||
// Returns string representation of |n| with 2 fractional digits.
|
// Returns string representation of |n| with 2 fractional digits.
|
||||||
std::string dtos(double n);
|
std::string dtos(double n);
|
||||||
|
|
||||||
inline constexpr auto count_digit_tbl = []() {
|
inline constexpr auto count_digit_tbl = [] {
|
||||||
std::array<uint64_t, std::numeric_limits<uint64_t>::digits10> tbl;
|
std::array<uint64_t, std::numeric_limits<uint64_t>::digits10> tbl;
|
||||||
|
|
||||||
uint64_t x = 1;
|
uint64_t x = 1;
|
||||||
@@ -751,7 +751,7 @@ template <std::unsigned_integral T> constexpr size_t count_digit(T x) {
|
|||||||
return y + 1;
|
return y + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline constexpr auto utos_digits = []() {
|
inline constexpr auto utos_digits = [] {
|
||||||
std::array<char, 200> a;
|
std::array<char, 200> a;
|
||||||
|
|
||||||
for (size_t i = 0; i < 100; ++i) {
|
for (size_t i = 0; i < 100; ++i) {
|
||||||
@@ -1290,7 +1290,7 @@ template <std::input_or_output_iterator O, typename Generator>
|
|||||||
void random_bytes(O first, O last, Generator &&gen) {
|
void random_bytes(O first, O last, Generator &&gen) {
|
||||||
std::uniform_int_distribution<uint8_t> dis;
|
std::uniform_int_distribution<uint8_t> dis;
|
||||||
std::ranges::generate(std::move(first), std::move(last),
|
std::ranges::generate(std::move(first), std::move(last),
|
||||||
[&dis, &gen]() { return dis(gen); });
|
[&dis, &gen] { return dis(gen); });
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fills the buffer pointed by |data| of length |destlen| with the
|
// Fills the buffer pointed by |data| of length |destlen| with the
|
||||||
|
|||||||
Reference in New Issue
Block a user