aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbabenko <babenko@yandex-team.com>2024-04-22 15:19:58 +0300
committerbabenko <babenko@yandex-team.com>2024-04-22 15:30:36 +0300
commit6bdb59db66aac07e5020736043958e5735d54d68 (patch)
tree9aa7a1173740bd2f4d645bf4b1887afffabd7d7b
parent321f6f149d01a73e2b778c17a3e08891d4826209 (diff)
downloadydb-6bdb59db66aac07e5020736043958e5735d54d68.tar.gz
YT-18571: Lambda cosmetics
3662fc28ab119b78f1a21d2ee71854328771718c
-rw-r--r--yt/yt/client/api/persistent_queue.cpp4
-rw-r--r--yt/yt/client/api/rpc_proxy/table_reader.cpp2
-rw-r--r--yt/yt/client/api/rpc_proxy/transaction_impl.cpp2
-rw-r--r--yt/yt/client/driver/cypress_commands.cpp2
-rw-r--r--yt/yt/client/driver/journal_commands.cpp4
-rw-r--r--yt/yt/client/driver/queue_commands.cpp2
-rw-r--r--yt/yt/client/driver/table_commands.cpp4
-rw-r--r--yt/yt/client/federated/client.cpp2
-rw-r--r--yt/yt/client/federated/unittests/client_ut.cpp6
-rw-r--r--yt/yt/client/hedging/unittests/hedging_ut.cpp12
-rw-r--r--yt/yt/client/table_client/key.cpp2
-rw-r--r--yt/yt/client/table_client/logical_type.cpp12
-rw-r--r--yt/yt/client/unittests/logical_type_ut.cpp20
-rw-r--r--yt/yt/client/ypath/rich.cpp6
-rw-r--r--yt/yt/core/actions/unittests/bind_ut.cpp6
-rw-r--r--yt/yt/core/actions/unittests/future_ut.cpp2
-rw-r--r--yt/yt/core/bus/tcp/connection.cpp2
-rw-r--r--yt/yt/core/compression/zstd.cpp2
-rw-r--r--yt/yt/core/concurrency/periodic_executor.cpp2
-rw-r--r--yt/yt/core/concurrency/thread_pool_detail.cpp2
-rw-r--r--yt/yt/core/concurrency/unittests/count_down_latch_ut.cpp4
-rw-r--r--yt/yt/core/concurrency/unittests/delayed_executor_ut.cpp12
-rw-r--r--yt/yt/core/concurrency/unittests/fair_share_invoker_pool_ut.cpp2
-rw-r--r--yt/yt/core/concurrency/unittests/periodic_ut.cpp12
-rw-r--r--yt/yt/core/concurrency/unittests/profiled_fair_share_invoker_pool_ut.cpp2
-rw-r--r--yt/yt/core/concurrency/unittests/scheduled_executor_ut.cpp12
-rw-r--r--yt/yt/core/concurrency/unittests/scheduler_ut.cpp86
-rw-r--r--yt/yt/core/concurrency/unittests/throughput_throttler_ut.cpp8
-rw-r--r--yt/yt/core/crypto/tls.cpp10
-rw-r--r--yt/yt/core/http/retrying_client.cpp2
-rw-r--r--yt/yt/core/logging/zstd_compression.cpp2
-rw-r--r--yt/yt/core/misc/arithmetic_formula.cpp2
-rw-r--r--yt/yt/core/misc/fenwick_tree-inl.h2
-rw-r--r--yt/yt/core/misc/proc.cpp2
-rw-r--r--yt/yt/core/misc/unittests/arithmetic_formula_ut.cpp2
-rw-r--r--yt/yt/core/misc/unittests/async_expiring_cache_ut.cpp4
-rw-r--r--yt/yt/core/misc/unittests/error_ut.cpp2
-rw-r--r--yt/yt/core/misc/unittests/fenwick_tree_ut.cpp8
-rw-r--r--yt/yt/core/misc/unittests/ref_counted_tracker_ut.cpp6
-rw-r--r--yt/yt/core/misc/unittests/topological_ordering_ut.cpp3
-rw-r--r--yt/yt/core/net/address.cpp6
-rw-r--r--yt/yt/core/rpc/grpc/server.cpp2
-rw-r--r--yt/yt/core/rpc/server_detail.cpp2
-rw-r--r--yt/yt/core/rpc/stream.cpp4
-rw-r--r--yt/yt/core/yson/unittests/protobuf_yson_ut.cpp18
-rw-r--r--yt/yt/core/yson/unittests/yson_pull_parser_ut.cpp3
-rw-r--r--yt/yt/core/ytree/unittests/yson_struct_ut.cpp2
-rw-r--r--yt/yt/core/ytree/ypath_client.cpp4
-rw-r--r--yt/yt/core/ytree/ypath_service.cpp4
-rw-r--r--yt/yt/core/ytree/yson_struct_detail-inl.h2
-rw-r--r--yt/yt/core/ytree/yson_struct_detail.cpp2
-rw-r--r--yt/yt/library/decimal/unittests/decimal_ut.cpp5
-rw-r--r--yt/yt/library/formats/protobuf_parser.cpp4
-rw-r--r--yt/yt/library/formats/protobuf_writer.cpp4
-rw-r--r--yt/yt/library/formats/schemaful_dsv_writer.cpp4
-rw-r--r--yt/yt/library/formats/skiff_yson_converter.cpp16
-rw-r--r--yt/yt/library/numeric/algorithm_helpers-inl.h2
-rw-r--r--yt/yt/library/process/process.cpp6
-rw-r--r--yt/yt/library/process/unittests/pipes_ut.cpp2
-rw-r--r--yt/yt/library/process/unittests/process_ut.cpp2
-rw-r--r--yt/yt/library/process/unittests/subprocess_ut.cpp6
-rw-r--r--yt/yt/library/profiling/perf/counters.cpp2
-rw-r--r--yt/yt/library/profiling/solomon/registry.cpp28
-rw-r--r--yt/yt/library/profiling/unittests/deps/main.cpp3
-rw-r--r--yt/yt/library/program/config.cpp2
-rw-r--r--yt/yt/library/tracing/jaeger/tracer.cpp2
-rw-r--r--yt/yt/library/ytprof/cpu_profiler.cpp2
67 files changed, 210 insertions, 208 deletions
diff --git a/yt/yt/client/api/persistent_queue.cpp b/yt/yt/client/api/persistent_queue.cpp
index 77d88ba1e5..1e334e7f7a 100644
--- a/yt/yt/client/api/persistent_queue.cpp
+++ b/yt/yt/client/api/persistent_queue.cpp
@@ -424,12 +424,12 @@ private:
i64 batchBeginRowIndex = -1;
- auto beginBatch = [&] () {
+ auto beginBatch = [&] {
YT_VERIFY(batchBeginRowIndex < 0);
batchBeginRowIndex = currentRowIndex;
};
- auto endBatch = [&] () {
+ auto endBatch = [&] {
if (batchBeginRowIndex < 0) {
return;
}
diff --git a/yt/yt/client/api/rpc_proxy/table_reader.cpp b/yt/yt/client/api/rpc_proxy/table_reader.cpp
index 2bb1410874..7703fc4c5e 100644
--- a/yt/yt/client/api/rpc_proxy/table_reader.cpp
+++ b/yt/yt/client/api/rpc_proxy/table_reader.cpp
@@ -210,7 +210,7 @@ private:
};
if (rowsWithStatistics.Rows.Empty()) {
- return ExpectEndOfStream(Underlying_).Apply(BIND([=] () {
+ return ExpectEndOfStream(Underlying_).Apply(BIND([=] {
return std::move(rowsWithStatistics);
}));
}
diff --git a/yt/yt/client/api/rpc_proxy/transaction_impl.cpp b/yt/yt/client/api/rpc_proxy/transaction_impl.cpp
index 28027efa25..a5819f423a 100644
--- a/yt/yt/client/api/rpc_proxy/transaction_impl.cpp
+++ b/yt/yt/client/api/rpc_proxy/transaction_impl.cpp
@@ -478,7 +478,7 @@ void TTransaction::ModifyRows(
if (future) {
future
- .Subscribe(BIND([=, this, this_ = MakeStrong(this)](const TError& error) {
+ .Subscribe(BIND([=, this, this_ = MakeStrong(this)] (const TError& error) {
if (!error.IsOK()) {
YT_LOG_DEBUG(error, "Error sending row modifications");
YT_UNUSED_FUTURE(Abort());
diff --git a/yt/yt/client/driver/cypress_commands.cpp b/yt/yt/client/driver/cypress_commands.cpp
index 0d3c4a3c82..622e20fe5b 100644
--- a/yt/yt/client/driver/cypress_commands.cpp
+++ b/yt/yt/client/driver/cypress_commands.cpp
@@ -395,7 +395,7 @@ void TLockCommand::DoExecute(ICommandContextPtr context)
ProduceSingleOutputValue(context, "lock_id", lockResult.LockId);
break;
default:
- ProduceOutput(context, [&](NYson::IYsonConsumer* consumer) {
+ ProduceOutput(context, [&] (NYson::IYsonConsumer* consumer) {
BuildYsonFluently(consumer)
.BeginMap()
.Item("lock_id").Value(lockResult.LockId)
diff --git a/yt/yt/client/driver/journal_commands.cpp b/yt/yt/client/driver/journal_commands.cpp
index 5ab1a6abcc..5e48c447dd 100644
--- a/yt/yt/client/driver/journal_commands.cpp
+++ b/yt/yt/client/driver/journal_commands.cpp
@@ -84,7 +84,7 @@ void TReadJournalCommand::DoExecute(ICommandContextPtr context)
// TODO(babenko): provide custom allocation tag
TBlobOutput buffer;
- auto flushBuffer = [&] () {
+ auto flushBuffer = [&] {
WaitFor(output->Write(buffer.Flush()))
.ThrowOnError();
};
@@ -268,10 +268,8 @@ private:
void TWriteJournalCommand::Register(TRegistrar registrar)
{
registrar.Parameter("path", &TThis::Path);
-
registrar.Parameter("journal_writer", &TThis::JournalWriter)
.Default();
-
registrar.ParameterWithUniversalAccessor<bool>(
"enable_chunk_preallocation",
[] (TThis* command) -> auto& {
diff --git a/yt/yt/client/driver/queue_commands.cpp b/yt/yt/client/driver/queue_commands.cpp
index ccb52d8cc1..f3504ad8c9 100644
--- a/yt/yt/client/driver/queue_commands.cpp
+++ b/yt/yt/client/driver/queue_commands.cpp
@@ -79,7 +79,7 @@ void TListQueueConsumerRegistrationsCommand::DoExecute(ICommandContextPtr contex
auto registrations = WaitFor(asyncResult)
.ValueOrThrow();
- ProduceOutput(context, [&](NYson::IYsonConsumer* consumer) {
+ ProduceOutput(context, [&] (NYson::IYsonConsumer* consumer) {
BuildYsonFluently(consumer)
.DoListFor(registrations, [=] (TFluentList fluent, const TListQueueConsumerRegistrationsResult& registration) {
fluent
diff --git a/yt/yt/client/driver/table_commands.cpp b/yt/yt/client/driver/table_commands.cpp
index 3945305f11..b52ea8e631 100644
--- a/yt/yt/client/driver/table_commands.cpp
+++ b/yt/yt/client/driver/table_commands.cpp
@@ -110,7 +110,7 @@ void TReadTableCommand::DoExecute(ICommandContextPtr context)
BuildYsonMapFragmentFluently(consumer)
.Item("approximate_row_count").Value(reader->GetTotalRowCount())
.Item("omitted_inaccessible_columns").Value(reader->GetOmittedInaccessibleColumns())
- .DoIf(reader->GetTotalRowCount() > 0, [&](auto fluent) {
+ .DoIf(reader->GetTotalRowCount() > 0, [&] (auto fluent) {
fluent
.Item("start_row_index").Value(reader->GetStartRowIndex());
});
@@ -130,7 +130,7 @@ void TReadTableCommand::DoExecute(ICommandContextPtr context)
ControlAttributes,
0);
- auto finally = Finally([&] () {
+ auto finally = Finally([&] {
auto dataStatistics = reader->GetDataStatistics();
YT_LOG_DEBUG("Command statistics (RowCount: %v, WrittenSize: %v, "
"ReadUncompressedDataSize: %v, ReadCompressedDataSize: %v, "
diff --git a/yt/yt/client/federated/client.cpp b/yt/yt/client/federated/client.cpp
index fa7407095a..32bc9bfdbe 100644
--- a/yt/yt/client/federated/client.cpp
+++ b/yt/yt/client/federated/client.cpp
@@ -559,7 +559,7 @@ TClient::TClient(const std::vector<IClientPtr>& underlyingClients, TFederationCo
int priority = GetDataCenterByClient(client) == localDatacenter ? 1 : 0;
UnderlyingClients_.push_back(New<TClientDescription>(client, priority));
}
- std::stable_sort(UnderlyingClients_.begin(), UnderlyingClients_.end(), [](const auto& lhs, const auto& rhs) {
+ std::stable_sort(UnderlyingClients_.begin(), UnderlyingClients_.end(), [] (const auto& lhs, const auto& rhs) {
return lhs->Priority > rhs->Priority;
});
diff --git a/yt/yt/client/federated/unittests/client_ut.cpp b/yt/yt/client/federated/unittests/client_ut.cpp
index cedef2e3c5..8588e6dc66 100644
--- a/yt/yt/client/federated/unittests/client_ut.cpp
+++ b/yt/yt/client/federated/unittests/client_ut.cpp
@@ -33,7 +33,7 @@ struct TTestDataStorage
{
TTestDataStorage()
{
- LookupResult1 = [&]() {
+ LookupResult1 = [&] {
auto rowBuffer = NYT::New<NTableClient::TRowBuffer>();
std::vector<NTableClient::TUnversionedRow> rows;
for (ui64 key : {10, 11}) {
@@ -47,7 +47,7 @@ struct TTestDataStorage
};
} ();
- LookupResult2 = [&]() {
+ LookupResult2 = [&] {
auto rowBuffer = NYT::New<NTableClient::TRowBuffer>();
std::vector<NTableClient::TUnversionedRow> rows;
for (ui64 key : {12, 13}) {
@@ -64,7 +64,7 @@ struct TTestDataStorage
NameTable = NYT::New<NTableClient::TNameTable>();
i32 keyField = NameTable->GetIdOrRegisterName(KeyColumn);
- auto keys = [&]() {
+ auto keys = [&] {
auto rowBuffer = NYT::New<NTableClient::TRowBuffer>();
std::vector<NTableClient::TUnversionedRow> keysVector;
for (ui64 key : {10, 11}) {
diff --git a/yt/yt/client/hedging/unittests/hedging_ut.cpp b/yt/yt/client/hedging/unittests/hedging_ut.cpp
index 6362d491b9..43ce0d0cb6 100644
--- a/yt/yt/client/hedging/unittests/hedging_ut.cpp
+++ b/yt/yt/client/hedging/unittests/hedging_ut.cpp
@@ -209,7 +209,7 @@ TEST(THedgingClientTest, GetclientResult2WhenFirstClientIsSleeping)
auto mockClient2 = New<TStrictMockClient>();
EXPECT_CALL(*mockClient1, ListNode(path, _))
- .WillOnce(Return(NConcurrency::TDelayedExecutor::MakeDelayed(TDuration::Seconds(2)).Apply(BIND([=] () { return clientResult1; }))));
+ .WillOnce(Return(NConcurrency::TDelayedExecutor::MakeDelayed(TDuration::Seconds(2)).Apply(BIND([=] { return clientResult1; }))));
EXPECT_CALL(*mockClient2, ListNode(path, _))
.WillRepeatedly(Return(MakeFuture(clientResult2)));
@@ -235,7 +235,7 @@ TEST(THedgingClientTest, FirstClientIsBannedBecauseResponseWasCancelled)
auto mockClient2 = New<TStrictMockClient>();
EXPECT_CALL(*mockClient1, ListNode(path, _))
- .WillOnce(Return(NConcurrency::TDelayedExecutor::MakeDelayed(SleepQuantum * 2).Apply(BIND([=] () { return clientResult1; }))))
+ .WillOnce(Return(NConcurrency::TDelayedExecutor::MakeDelayed(SleepQuantum * 2).Apply(BIND([=] { return clientResult1; }))))
.WillRepeatedly(Return(MakeFuture(clientResult1)));
EXPECT_CALL(*mockClient2, ListNode(path, _))
.WillRepeatedly(Return(MakeFuture(clientResult2)));
@@ -276,10 +276,10 @@ TEST(THedgingClientTest, AmnestyBanPenaltyIfClientSucceeded)
.WillRepeatedly(Return(MakeFuture(clientResult1)));
EXPECT_CALL(*mockClient2, ListNode(path, _))
.WillOnce(Return(MakeFuture(clientResult2)))
- .WillOnce(Return(NConcurrency::TDelayedExecutor::MakeDelayed(TDuration::Seconds(100)).Apply(BIND([=] () { return clientResult2; }))))
+ .WillOnce(Return(NConcurrency::TDelayedExecutor::MakeDelayed(TDuration::Seconds(100)).Apply(BIND([=] { return clientResult2; }))))
.WillRepeatedly(Return(MakeFuture(clientResult2)));
EXPECT_CALL(*mockClient3, ListNode(path, _))
- .WillRepeatedly(Return(NConcurrency::TDelayedExecutor::MakeDelayed(TDuration::Seconds(100)).Apply(BIND([=] () { return thirdClientResult; }))));
+ .WillRepeatedly(Return(NConcurrency::TDelayedExecutor::MakeDelayed(TDuration::Seconds(100)).Apply(BIND([=] { return thirdClientResult; }))));
auto client = CreateTestHedgingClient(
SleepQuantum * 2,
@@ -320,7 +320,7 @@ TEST(THedgingClientTest, MultiThread)
EXPECT_CALL(*mockClient1, ListNode(path, _)).WillRepeatedly([=] (const NYPath::TYPath&, const NApi::TListNodeOptions& options) {
if (options.Timeout) {
- return NConcurrency::TDelayedExecutor::MakeDelayed(*options.Timeout).Apply(BIND([=] () {
+ return NConcurrency::TDelayedExecutor::MakeDelayed(*options.Timeout).Apply(BIND([=] {
return clientResult1;
}));
}
@@ -337,7 +337,7 @@ TEST(THedgingClientTest, MultiThread)
auto threadPool = NConcurrency::CreateThreadPool(10, "test");
std::vector<TFuture<void>> futures;
for (int i = 0; i < 100; ++i) {
- futures.push_back(BIND([=] () {
+ futures.push_back(BIND([=] {
for (int j = 0; j < 100; ++j) {
NApi::TListNodeOptions options;
// on each 5th request for 1st and 2nd thread, the first client will timeout
diff --git a/yt/yt/client/table_client/key.cpp b/yt/yt/client/table_client/key.cpp
index 895ec5d5ac..92953c792d 100644
--- a/yt/yt/client/table_client/key.cpp
+++ b/yt/yt/client/table_client/key.cpp
@@ -143,7 +143,7 @@ void Serialize(const TKey& key, IYsonConsumer* consumer)
{
if (key) {
BuildYsonFluently(consumer)
- .DoListFor(MakeRange(key.Begin(), key.End()), [&](TFluentList fluent, const TUnversionedValue& value) {
+ .DoListFor(MakeRange(key.Begin(), key.End()), [&] (TFluentList fluent, const TUnversionedValue& value) {
fluent
.Item()
.Value(value);
diff --git a/yt/yt/client/table_client/logical_type.cpp b/yt/yt/client/table_client/logical_type.cpp
index 50ff4ceacc..c2a051630c 100644
--- a/yt/yt/client/table_client/logical_type.cpp
+++ b/yt/yt/client/table_client/logical_type.cpp
@@ -33,7 +33,7 @@ static void WalkImpl(
{
onElement(*walkContext, descriptor);
walkContext->Stack.push_back(descriptor);
- auto g = Finally([&]() {
+ auto g = Finally([&] {
walkContext->Stack.pop_back();
});
const auto metatype = descriptor.GetType()->GetMetatype();
@@ -801,7 +801,7 @@ int TDictLogicalType::GetTypeComplexity() const
void TDictLogicalType::ValidateNode(const TWalkContext&) const
{
TComplexTypeFieldDescriptor descriptor("<dict-key>", GetKey());
- Walk(descriptor, [](const TWalkContext&, const TComplexTypeFieldDescriptor& descriptor) {
+ Walk(descriptor, [] (const TWalkContext&, const TComplexTypeFieldDescriptor& descriptor) {
const auto& logicalType = descriptor.GetType();
// NB. We intentionally list all metatypes and simple types here.
@@ -1702,7 +1702,7 @@ void Deserialize(TTypeV3LogicalTypeWrapper& wrapper, NYTree::INodePtr node)
if (node->GetType() == NYTree::ENodeType::String) {
auto typeNameString = node->AsString()->GetValue();
auto typeName = FromTypeV3(typeNameString);
- std::visit([&](const auto& arg) {
+ std::visit([&] (const auto& arg) {
using T = std::decay_t<decltype(arg)>;
if constexpr (std::is_same_v<T, ESimpleLogicalValueType>) {
wrapper.LogicalType = SimpleLogicalType(arg);
@@ -1724,7 +1724,7 @@ void Deserialize(TTypeV3LogicalTypeWrapper& wrapper, NYTree::INodePtr node)
auto mapNode = node->AsMap();
auto typeNameString = mapNode->GetChildValueOrThrow<TString>("type_name");
auto typeName = FromTypeV3(typeNameString);
- std::visit([&](const auto& typeName) {
+ std::visit([&] (const auto& typeName) {
using T = std::decay_t<decltype(typeName)>;
if constexpr (std::is_same_v<T, ESimpleLogicalValueType>) {
wrapper.LogicalType = SimpleLogicalType(typeName);
@@ -1835,7 +1835,7 @@ void DeserializeV3Impl(TLogicalTypePtr& type, TYsonPullParserCursor* cursor, int
if ((*cursor)->GetType() == EYsonItemType::StringValue) {
auto typeNameString = (*cursor)->UncheckedAsString();
auto typeName = FromTypeV3(typeNameString);
- std::visit([&](const auto& arg) {
+ std::visit([&] (const auto& arg) {
using T = std::decay_t<decltype(arg)>;
if constexpr (std::is_same_v<T, ESimpleLogicalValueType>) {
type = SimpleLogicalType(arg);
@@ -1947,7 +1947,7 @@ void DeserializeV3Impl(TLogicalTypePtr& type, TYsonPullParserCursor* cursor, int
THROW_ERROR_EXCEPTION("\"type_name\" is required");
}
- type = std::visit([&](const auto& typeName) {
+ type = std::visit([&] (const auto& typeName) {
using T = std::decay_t<decltype(typeName)>;
if constexpr (std::is_same_v<T, ESimpleLogicalValueType>) {
return SimpleLogicalType(typeName);
diff --git a/yt/yt/client/unittests/logical_type_ut.cpp b/yt/yt/client/unittests/logical_type_ut.cpp
index 4912ccbf7c..3c0b8669cf 100644
--- a/yt/yt/client/unittests/logical_type_ut.cpp
+++ b/yt/yt/client/unittests/logical_type_ut.cpp
@@ -756,61 +756,61 @@ using TCombineTypeFunc = std::function<TLogicalTypePtr(const TLogicalTypePtr&)>;
std::vector<std::pair<TString, TCombineTypeFunc>> CombineFunctions = {
{
"optional",
- [](const TLogicalTypePtr& type) {
+ [] (const TLogicalTypePtr& type) {
return OptionalLogicalType(type);
},
},
{
"list",
- [](const TLogicalTypePtr& type) {
+ [] (const TLogicalTypePtr& type) {
return ListLogicalType(type);
},
},
{
"struct",
- [](const TLogicalTypePtr& type) {
+ [] (const TLogicalTypePtr& type) {
return StructLogicalType({{"field", type}});
},
},
{
"tuple",
- [](const TLogicalTypePtr& type) {
+ [] (const TLogicalTypePtr& type) {
return TupleLogicalType({type});
},
},
{
"variant_struct",
- [](const TLogicalTypePtr& type) {
+ [] (const TLogicalTypePtr& type) {
return VariantStructLogicalType({{"field", type}});
},
},
{
"variant_tuple",
- [](const TLogicalTypePtr& type) {
+ [] (const TLogicalTypePtr& type) {
return VariantTupleLogicalType({type});
},
},
{
"dict",
- [](const TLogicalTypePtr& type) {
+ [] (const TLogicalTypePtr& type) {
return DictLogicalType(SimpleLogicalType(ESimpleLogicalValueType::String), type);
},
},
{
"dict-key",
- [](const TLogicalTypePtr& type) {
+ [] (const TLogicalTypePtr& type) {
return DictLogicalType(type, SimpleLogicalType(ESimpleLogicalValueType::String));
},
},
{
"dict-value",
- [](const TLogicalTypePtr& type) {
+ [] (const TLogicalTypePtr& type) {
return DictLogicalType(SimpleLogicalType(ESimpleLogicalValueType::String), type);
}
},
{
"tagged",
- [](const TLogicalTypePtr& type) {
+ [] (const TLogicalTypePtr& type) {
return TaggedLogicalType("foo", type);
}
}
diff --git a/yt/yt/client/ypath/rich.cpp b/yt/yt/client/ypath/rich.cpp
index c1afa96d29..03484638e1 100644
--- a/yt/yt/client/ypath/rich.cpp
+++ b/yt/yt/client/ypath/rich.cpp
@@ -128,7 +128,7 @@ auto RunAttributeAccessor(const TRichYPath& path, const TString& key, TFunc acce
template <class T>
T GetAttribute(const TRichYPath& path, const TString& key, const T& defaultValue)
{
- return RunAttributeAccessor(path, key, [&] () {
+ return RunAttributeAccessor(path, key, [&] {
return path.Attributes().Get(key, defaultValue);
});
}
@@ -136,14 +136,14 @@ T GetAttribute(const TRichYPath& path, const TString& key, const T& defaultValue
template <class T>
typename TOptionalTraits<T>::TOptional FindAttribute(const TRichYPath& path, const TString& key)
{
- return RunAttributeAccessor(path, key, [&] () {
+ return RunAttributeAccessor(path, key, [&] {
return path.Attributes().Find<T>(key);
});
}
TYsonString FindAttributeYson(const TRichYPath& path, const TString& key)
{
- return RunAttributeAccessor(path, key, [&] () {
+ return RunAttributeAccessor(path, key, [&] {
return path.Attributes().FindYson(key);
});
}
diff --git a/yt/yt/core/actions/unittests/bind_ut.cpp b/yt/yt/core/actions/unittests/bind_ut.cpp
index 3b0fe90989..3311dc8cf8 100644
--- a/yt/yt/core/actions/unittests/bind_ut.cpp
+++ b/yt/yt/core/actions/unittests/bind_ut.cpp
@@ -1091,7 +1091,7 @@ TEST_F(TBindTest, LambdaSupport)
{
int n = 1;
- TClosure closure = BIND([&n] () { ++n; });
+ TClosure closure = BIND([&n] { ++n; });
EXPECT_EQ(1, n);
closure();
EXPECT_EQ(2, n);
@@ -1125,7 +1125,7 @@ TEST_F(TBindTest, MutableLambdaSupport)
TEST_F(TBindTest, ConstLambdaSupport)
{
int n = 1;
- const auto l = [&n] () { ++n; return n; };
+ const auto l = [&n] { ++n; return n; };
const auto f = BIND(l);
EXPECT_EQ(2, f());
EXPECT_EQ(3, f());
@@ -1161,7 +1161,7 @@ TEST_F(TBindTest, MoveOnlyLambdaSupport)
TMoveOnly outer(5);
EXPECT_EQ(5u, outer.Value());
- auto f = BIND([inner = std::move(outer)] () { return inner.Value(); });
+ auto f = BIND([inner = std::move(outer)] { return inner.Value(); });
EXPECT_EQ(0u, outer.Value());
// Call twice just in case
diff --git a/yt/yt/core/actions/unittests/future_ut.cpp b/yt/yt/core/actions/unittests/future_ut.cpp
index 5185d0cd8d..96ee01ade9 100644
--- a/yt/yt/core/actions/unittests/future_ut.cpp
+++ b/yt/yt/core/actions/unittests/future_ut.cpp
@@ -1414,7 +1414,7 @@ TEST_F(TFutureTest, AsyncViaCanceledInvoker)
{
auto context = New<TCancelableContext>();
auto invoker = context->CreateInvoker(GetSyncInvoker());
- auto generator = BIND([] () {}).AsyncVia(invoker);
+ auto generator = BIND([] {}).AsyncVia(invoker);
context->Cancel(TError("oops"));
auto future = generator();
auto error = future.Get();
diff --git a/yt/yt/core/bus/tcp/connection.cpp b/yt/yt/core/bus/tcp/connection.cpp
index 8ca65d22b5..7423eb8ee5 100644
--- a/yt/yt/core/bus/tcp/connection.cpp
+++ b/yt/yt/core/bus/tcp/connection.cpp
@@ -1475,7 +1475,7 @@ bool TTcpConnection::MaybeEncodeFragments()
size_t encodedSize = 0;
size_t coalescedSize = 0;
- auto flushCoalesced = [&] () {
+ auto flushCoalesced = [&] {
if (coalescedSize > 0) {
EncodedFragments_.push(TRef(buffer->End() - coalescedSize, coalescedSize));
coalescedSize = 0;
diff --git a/yt/yt/core/compression/zstd.cpp b/yt/yt/core/compression/zstd.cpp
index e24a076938..da70d042dd 100644
--- a/yt/yt/core/compression/zstd.cpp
+++ b/yt/yt/core/compression/zstd.cpp
@@ -50,7 +50,7 @@ void ZstdCompress(int level, TSource* source, TBlob* output)
}
auto context = ZSTD_createCCtx();
- auto contextGuard = Finally([&] () {
+ auto contextGuard = Finally([&] {
ZSTD_freeCCtx(context);
});
diff --git a/yt/yt/core/concurrency/periodic_executor.cpp b/yt/yt/core/concurrency/periodic_executor.cpp
index 17797eb35b..7447080686 100644
--- a/yt/yt/core/concurrency/periodic_executor.cpp
+++ b/yt/yt/core/concurrency/periodic_executor.cpp
@@ -57,7 +57,7 @@ void TDefaultInvocationTimePolicy::SetOptions(std::optional<TDuration> period)
TInstant TDefaultInvocationTimePolicy::NextDeadline()
{
- auto randomGenerator = [] () {
+ auto randomGenerator = [] {
double rand = RandomNumber<double>();
return 2.0 * rand - 1.0;
diff --git a/yt/yt/core/concurrency/thread_pool_detail.cpp b/yt/yt/core/concurrency/thread_pool_detail.cpp
index 9e2b0ee1b2..0008f4a8c6 100644
--- a/yt/yt/core/concurrency/thread_pool_detail.cpp
+++ b/yt/yt/core/concurrency/thread_pool_detail.cpp
@@ -73,7 +73,7 @@ TClosure TThreadPoolBase::MakeFinalizerCallback()
std::swap(threads, Threads_);
}
- return BIND_NO_PROPAGATE([threads = std::move(threads)] () {
+ return BIND_NO_PROPAGATE([threads = std::move(threads)] {
for (const auto& thread : threads) {
thread->Stop();
}
diff --git a/yt/yt/core/concurrency/unittests/count_down_latch_ut.cpp b/yt/yt/core/concurrency/unittests/count_down_latch_ut.cpp
index 6078e838a5..3e7172689b 100644
--- a/yt/yt/core/concurrency/unittests/count_down_latch_ut.cpp
+++ b/yt/yt/core/concurrency/unittests/count_down_latch_ut.cpp
@@ -56,14 +56,14 @@ TEST(TCountDownLatch, TwoThreadsTwoLatches)
TCountDownLatch first(1);
TCountDownLatch second(1);
- std::thread t1([&] () {
+ std::thread t1([&] {
first.Wait();
second.CountDown();
EXPECT_EQ(0, first.GetCount());
EXPECT_EQ(0, second.GetCount());
});
- std::thread t2([&] () {
+ std::thread t2([&] {
first.CountDown();
second.Wait();
EXPECT_EQ(0, first.GetCount());
diff --git a/yt/yt/core/concurrency/unittests/delayed_executor_ut.cpp b/yt/yt/core/concurrency/unittests/delayed_executor_ut.cpp
index b453b96fba..138c7a9cd9 100644
--- a/yt/yt/core/concurrency/unittests/delayed_executor_ut.cpp
+++ b/yt/yt/core/concurrency/unittests/delayed_executor_ut.cpp
@@ -20,7 +20,7 @@ TEST(TDelayedExecutorTest, SubmitLarge)
auto state = std::make_shared<TProbeState>();
auto cookie = TDelayedExecutor::Submit(
- BIND([fired, state, probe = TProbe(state.get())] () { ++*fired; }),
+ BIND([fired, state, probe = TProbe(state.get())] { ++*fired; }),
TDuration::MilliSeconds(1000));
Sleep(TDuration::MilliSeconds(500));
@@ -40,7 +40,7 @@ TEST(TDelayedExecutorTest, SubmitSmall)
auto state = std::make_shared<TProbeState>();
auto cookie = TDelayedExecutor::Submit(
- BIND([fired, state, probe = TProbe(state.get())] () { ++*fired; }),
+ BIND([fired, state, probe = TProbe(state.get())] { ++*fired; }),
TDuration::MilliSeconds(100));
Sleep(TDuration::MilliSeconds(50));
@@ -60,7 +60,7 @@ TEST(TDelayedExecutorTest, SubmitZeroDelay)
auto state = std::make_shared<TProbeState>();
auto cookie1 = TDelayedExecutor::Submit(
- BIND([fired, state, probe = TProbe(state.get())] () { ++*fired; }),
+ BIND([fired, state, probe = TProbe(state.get())] { ++*fired; }),
TDuration::MilliSeconds(0));
Sleep(TDuration::MilliSeconds(10));
@@ -68,7 +68,7 @@ TEST(TDelayedExecutorTest, SubmitZeroDelay)
EXPECT_EQ(1, *fired);
auto cookie2 = TDelayedExecutor::Submit(
- BIND([fired, state, probe = TProbe(state.get())]() { ++*fired; }),
+ BIND([fired, state, probe = TProbe(state.get())] { ++*fired; }),
TDuration::MilliSeconds(10));
Sleep(TDuration::MilliSeconds(50));
@@ -88,7 +88,7 @@ TEST(TDelayedExecutorTest, StressTest)
auto delay = rand() % 50;
auto cookie = TDelayedExecutor::Submit(
- BIND([start, delay, fired] () {
+ BIND([start, delay, fired] {
i64 diff = (TInstant::Now() - start).MilliSeconds();
EXPECT_LE(delay, diff + 10);
EXPECT_LE(diff, delay + 100);
@@ -110,7 +110,7 @@ TEST(TDelayedExecutorTest, SubmitAndCancel)
auto state = std::make_shared<TProbeState>();
auto cookie = TDelayedExecutor::Submit(
- BIND([fired, state, probe = TProbe(state.get())] () { ++*fired; }),
+ BIND([fired, state, probe = TProbe(state.get())] { ++*fired; }),
TDuration::MilliSeconds(10));
TDelayedExecutor::CancelAndClear(cookie);
diff --git a/yt/yt/core/concurrency/unittests/fair_share_invoker_pool_ut.cpp b/yt/yt/core/concurrency/unittests/fair_share_invoker_pool_ut.cpp
index e6f0b6feac..8c7efa2adb 100644
--- a/yt/yt/core/concurrency/unittests/fair_share_invoker_pool_ut.cpp
+++ b/yt/yt/core/concurrency/unittests/fair_share_invoker_pool_ut.cpp
@@ -251,7 +251,7 @@ protected:
auto invokerPool = CreateInvokerPool(Queues_[0]->GetInvoker(), switchToCount + 1);
- auto callback = BIND([this, invokerPool, switchToCount] () {
+ auto callback = BIND([this, invokerPool, switchToCount] {
for (int i = 1; i <= switchToCount; ++i) {
ExpectInvokerIndex(i - 1);
Spin(Quantum * i);
diff --git a/yt/yt/core/concurrency/unittests/periodic_ut.cpp b/yt/yt/core/concurrency/unittests/periodic_ut.cpp
index d033ed3f93..fb452bfc6e 100644
--- a/yt/yt/core/concurrency/unittests/periodic_ut.cpp
+++ b/yt/yt/core/concurrency/unittests/periodic_ut.cpp
@@ -30,7 +30,7 @@ TEST_W(TPeriodicTest, Simple)
{
std::atomic<int> count = {0};
- auto callback = BIND([&] () {
+ auto callback = BIND([&] {
TDelayedExecutor::WaitForDuration(TDuration::MilliSeconds(200));
++count;
});
@@ -66,7 +66,7 @@ TEST_W(TPeriodicTest, SimpleScheduleOutOfBand)
{
std::atomic<int> count = {0};
- auto callback = BIND([&] () {
+ auto callback = BIND([&] {
++count;
});
@@ -94,7 +94,7 @@ TEST_W(TPeriodicTest, ParallelStop)
{
std::atomic<int> count = {0};
- auto callback = BIND([&] () {
+ auto callback = BIND([&] {
++count;
TDelayedExecutor::WaitForDuration(TDuration::MilliSeconds(500));
++count;
@@ -132,7 +132,7 @@ TEST_W(TPeriodicTest, ParallelOnExecuted1)
{
std::atomic<int> count = 0;
- auto callback = BIND([&] () {
+ auto callback = BIND([&] {
TDelayedExecutor::WaitForDuration(TDuration::MilliSeconds(500));
++count;
});
@@ -169,7 +169,7 @@ TEST_W(TPeriodicTest, ParallelOnExecuted2)
{
std::atomic<int> count = 0;
- auto callback = BIND([&] () {
+ auto callback = BIND([&] {
TDelayedExecutor::WaitForDuration(TDuration::MilliSeconds(100));
++count;
});
@@ -206,7 +206,7 @@ TEST_W(TPeriodicTest, OnExecutedEventCanceled)
{
std::atomic<int> count = 0;
- auto callback = BIND([&] () {
+ auto callback = BIND([&] {
TDelayedExecutor::WaitForDuration(TDuration::MilliSeconds(100));
++count;
});
diff --git a/yt/yt/core/concurrency/unittests/profiled_fair_share_invoker_pool_ut.cpp b/yt/yt/core/concurrency/unittests/profiled_fair_share_invoker_pool_ut.cpp
index 86055fe9aa..2fbfa3fb27 100644
--- a/yt/yt/core/concurrency/unittests/profiled_fair_share_invoker_pool_ut.cpp
+++ b/yt/yt/core/concurrency/unittests/profiled_fair_share_invoker_pool_ut.cpp
@@ -264,7 +264,7 @@ protected:
auto invokerPool = CreateInvokerPool(Queues_[0]->GetInvoker(), switchToCount + 1);
- auto callback = BIND([this, invokerPool, switchToCount] () {
+ auto callback = BIND([this, invokerPool, switchToCount] {
for (int i = 1; i <= switchToCount; ++i) {
ExpectInvokerIndex(i - 1);
Spin(Quantum * i);
diff --git a/yt/yt/core/concurrency/unittests/scheduled_executor_ut.cpp b/yt/yt/core/concurrency/unittests/scheduled_executor_ut.cpp
index e04160aa3a..f19dc8278c 100644
--- a/yt/yt/core/concurrency/unittests/scheduled_executor_ut.cpp
+++ b/yt/yt/core/concurrency/unittests/scheduled_executor_ut.cpp
@@ -31,7 +31,7 @@ TEST_W(TScheduledExecutorTest, Simple)
const auto& interval = TDuration::MilliSeconds(200);
std::atomic<int> count = {0};
- auto callback = BIND([&] () {
+ auto callback = BIND([&] {
CheckTimeSlotCorrectness(interval);
++count;
});
@@ -54,7 +54,7 @@ TEST_W(TScheduledExecutorTest, SimpleScheduleOutOfBand)
{
std::atomic<int> count = {0};
- auto callback = BIND([&] () {
+ auto callback = BIND([&] {
++count;
});
@@ -84,7 +84,7 @@ TEST_W(TScheduledExecutorTest, ParallelStop)
const auto& interval = TDuration::MilliSeconds(10);
std::atomic<int> count = {0};
- auto callback = BIND([&] () {
+ auto callback = BIND([&] {
CheckTimeSlotCorrectness(interval);
++count;
TDelayedExecutor::WaitForDuration(TDuration::MilliSeconds(500));
@@ -124,7 +124,7 @@ TEST_W(TScheduledExecutorTest, ParallelOnExecuted1)
const auto& interval = TDuration::MilliSeconds(10);
std::atomic<int> count = 0;
- auto callback = BIND([&] () {
+ auto callback = BIND([&] {
CheckTimeSlotCorrectness(interval);
TDelayedExecutor::WaitForDuration(TDuration::MilliSeconds(500));
++count;
@@ -163,7 +163,7 @@ TEST_W(TScheduledExecutorTest, ParallelOnExecuted2)
const auto& interval = TDuration::MilliSeconds(400);
std::atomic<int> count = 0;
- auto callback = BIND([&] () {
+ auto callback = BIND([&] {
CheckTimeSlotCorrectness(interval);
TDelayedExecutor::WaitForDuration(TDuration::MilliSeconds(100));
++count;
@@ -202,7 +202,7 @@ TEST_W(TScheduledExecutorTest, OnExecutedEventCanceled)
const auto& interval = TDuration::MilliSeconds(50);
std::atomic<int> count = 0;
- auto callback = BIND([&] () {
+ auto callback = BIND([&] {
CheckTimeSlotCorrectness(interval);
TDelayedExecutor::WaitForDuration(TDuration::MilliSeconds(200));
++count;
diff --git a/yt/yt/core/concurrency/unittests/scheduler_ut.cpp b/yt/yt/core/concurrency/unittests/scheduler_ut.cpp
index 9424918fa0..12a8b32607 100644
--- a/yt/yt/core/concurrency/unittests/scheduler_ut.cpp
+++ b/yt/yt/core/concurrency/unittests/scheduler_ut.cpp
@@ -57,7 +57,7 @@ template <class T>
TFuture<T> MakeDelayedFuture(T x)
{
return TDelayedExecutor::MakeDelayed(SleepQuantum)
- .Apply(BIND([=] () { return x; }));
+ .Apply(BIND([=] { return x; }));
}
class TSchedulerTest
@@ -238,7 +238,7 @@ TEST_W(TSchedulerTest, WaitForCancelableInvoker1)
promise.Set();
}),
SleepQuantum);
- WaitFor(BIND([=] () {
+ WaitFor(BIND([=] {
EXPECT_THROW({ WaitFor(future).ThrowOnError(); }, TFiberCanceledException);
})
.AsyncVia(invoker)
@@ -378,7 +378,7 @@ TEST_F(TSchedulerTest, CurrentInvokerSync)
TEST_F(TSchedulerTest, CurrentInvokerInActionQueue)
{
auto invoker = Queue1->GetInvoker();
- BIND([=] () {
+ BIND([=] {
EXPECT_EQ(invoker, GetCurrentInvoker());
})
.AsyncVia(invoker).Run()
@@ -390,7 +390,7 @@ TEST_F(TSchedulerTest, Intercept)
auto invoker = Queue1->GetInvoker();
int counter1 = 0;
int counter2 = 0;
- BIND([&] () {
+ BIND([&] {
TContextSwitchGuard guard(
[&] {
EXPECT_EQ(counter1, 0);
@@ -417,7 +417,7 @@ TEST_F(TSchedulerTest, InterceptEnclosed)
int counter2 = 0;
int counter3 = 0;
int counter4 = 0;
- BIND([&] () {
+ BIND([&] {
{
TContextSwitchGuard guard(
[&] { ++counter1; },
@@ -446,11 +446,11 @@ TEST_F(TSchedulerTest, CurrentInvokerConcurrent)
auto invoker1 = Queue1->GetInvoker();
auto invoker2 = Queue2->GetInvoker();
- auto result1 = BIND([=] () {
+ auto result1 = BIND([=] {
EXPECT_EQ(invoker1, GetCurrentInvoker());
}).AsyncVia(invoker1).Run();
- auto result2 = BIND([=] () {
+ auto result2 = BIND([=] {
EXPECT_EQ(invoker2, GetCurrentInvoker());
}).AsyncVia(invoker2).Run();
@@ -462,7 +462,7 @@ TEST_W(TSchedulerTest, WaitForAsyncVia)
{
auto invoker = Queue1->GetInvoker();
- auto x = BIND([&] () { }).AsyncVia(invoker).Run();
+ auto x = BIND([&] { }).AsyncVia(invoker).Run();
WaitFor(x)
.ThrowOnError();
@@ -473,7 +473,7 @@ TEST_W(TSchedulerTest, WaitForAsyncVia)
TEST_F(TSchedulerTest, WaitForInSerializedInvoker1)
{
auto invoker = CreateSerializedInvoker(Queue1->GetInvoker());
- BIND([&] () {
+ BIND([&] {
for (int i = 0; i < 10; ++i) {
TDelayedExecutor::WaitForDuration(SleepQuantum);
}
@@ -489,12 +489,12 @@ TEST_F(TSchedulerTest, WaitForInSerializedInvoker2)
std::vector<TFuture<void>> futures;
bool finishedFirstAction = false;
- futures.emplace_back(BIND([&] () {
+ futures.emplace_back(BIND([&] {
TDelayedExecutor::WaitForDuration(SleepQuantum);
finishedFirstAction = true;
}).AsyncVia(invoker).Run());
- futures.emplace_back(BIND([&] () {
+ futures.emplace_back(BIND([&] {
if (finishedFirstAction) {
THROW_ERROR_EXCEPTION("Serialization error");
}
@@ -506,7 +506,7 @@ TEST_F(TSchedulerTest, WaitForInSerializedInvoker2)
TEST_F(TSchedulerTest, WaitForInBoundedConcurrencyInvoker1)
{
auto invoker = CreateBoundedConcurrencyInvoker(Queue1->GetInvoker(), 1);
- BIND([&] () {
+ BIND([&] {
for (int i = 0; i < 10; ++i) {
TDelayedExecutor::WaitForDuration(SleepQuantum);
}
@@ -520,11 +520,11 @@ TEST_F(TSchedulerTest, WaitForInBoundedConcurrencyInvoker2)
auto promise = NewPromise<void>();
auto future = promise.ToFuture();
- auto a1 = BIND([&] () {
+ auto a1 = BIND([&] {
promise.Set();
});
- auto a2 = BIND([&] () {
+ auto a2 = BIND([&] {
invoker->Invoke(a1);
WaitFor(future)
.ThrowOnError();
@@ -542,7 +542,7 @@ TEST_F(TSchedulerTest, WaitForInBoundedConcurrencyInvoker3)
bool a1called = false;
bool a1finished = false;
- auto a1 = BIND([&] () {
+ auto a1 = BIND([&] {
a1called = true;
WaitFor(future)
.ThrowOnError();
@@ -550,7 +550,7 @@ TEST_F(TSchedulerTest, WaitForInBoundedConcurrencyInvoker3)
});
bool a2called = false;
- auto a2 = BIND([&] () {
+ auto a2 = BIND([&] {
a2called = true;
});
@@ -621,7 +621,7 @@ TEST_F(TSchedulerTest, TestWaitUntilSet)
auto p1 = NewPromise<void>();
auto f1 = p1.ToFuture();
- YT_UNUSED_FUTURE(BIND([=] () {
+ YT_UNUSED_FUTURE(BIND([=] {
Sleep(SleepQuantum);
p1.Set();
}).AsyncVia(Queue1->GetInvoker()).Run());
@@ -634,10 +634,10 @@ TEST_F(TSchedulerTest, TestWaitUntilSet)
TEST_F(TSchedulerTest, AsyncViaCanceledBeforeStart)
{
auto invoker = Queue1->GetInvoker();
- auto asyncResult1 = BIND([] () {
+ auto asyncResult1 = BIND([] {
Sleep(SleepQuantum * 10);
}).AsyncVia(invoker).Run();
- auto asyncResult2 = BIND([] () {
+ auto asyncResult2 = BIND([] {
Sleep(SleepQuantum * 10);
}).AsyncVia(invoker).Run();
EXPECT_FALSE(asyncResult1.IsSet());
@@ -652,7 +652,7 @@ TEST_F(TSchedulerTest, AsyncViaCanceledBeforeStart)
TEST_F(TSchedulerTest, CancelCurrentFiber)
{
auto invoker = Queue1->GetInvoker();
- auto asyncResult = BIND([=] () {
+ auto asyncResult = BIND([=] {
NYT::NConcurrency::GetCurrentFiberCanceler().Run(TError("Error"));
SwitchTo(invoker);
}).AsyncVia(invoker).Run();
@@ -668,7 +668,7 @@ TEST_F(TSchedulerTest, YieldToFromCanceledFiber)
auto invoker2 = Queue2->GetInvoker();
auto asyncResult = BIND([=] () mutable {
- BIND([=] () {
+ BIND([=] {
NYT::NConcurrency::GetCurrentFiberCanceler().Run(TError("Error"));
}).AsyncVia(invoker2).Run().Get();
WaitFor(promise.ToFuture(), invoker2)
@@ -685,7 +685,7 @@ TEST_F(TSchedulerTest, YieldToFromCanceledFiber)
TEST_F(TSchedulerTest, JustYield1)
{
auto invoker = Queue1->GetInvoker();
- auto asyncResult = BIND([] () {
+ auto asyncResult = BIND([] {
for (int i = 0; i < 10; ++i) {
Yield();
}
@@ -699,7 +699,7 @@ TEST_F(TSchedulerTest, JustYield2)
bool flag = false;
- auto asyncResult = BIND([&] () {
+ auto asyncResult = BIND([&] {
for (int i = 0; i < 2; ++i) {
Sleep(SleepQuantum);
Yield();
@@ -708,7 +708,7 @@ TEST_F(TSchedulerTest, JustYield2)
}).AsyncVia(invoker).Run();
// This callback must complete before the first.
- auto errorOrValue = BIND([&] () {
+ auto errorOrValue = BIND([&] {
return flag;
}).AsyncVia(invoker).Run().Get();
@@ -720,10 +720,10 @@ TEST_F(TSchedulerTest, JustYield2)
TEST_F(TSchedulerTest, CancelInAdjacentCallback)
{
auto invoker = Queue1->GetInvoker();
- auto asyncResult1 = BIND([=] () {
+ auto asyncResult1 = BIND([=] {
NYT::NConcurrency::GetCurrentFiberCanceler().Run(TError("Error"));
}).AsyncVia(invoker).Run().Get();
- auto asyncResult2 = BIND([=] () {
+ auto asyncResult2 = BIND([=] {
Yield();
}).AsyncVia(invoker).Run().Get();
EXPECT_TRUE(asyncResult1.IsOK());
@@ -734,7 +734,7 @@ TEST_F(TSchedulerTest, CancelInApply)
{
auto invoker = Queue1->GetInvoker();
- BIND([=] () {
+ BIND([=] {
auto promise = NewPromise<void>();
YT_UNUSED_FUTURE(promise.ToFuture().Apply(BIND([] {
@@ -766,7 +766,7 @@ TEST_F(TSchedulerTest, CancelInApplyUnique)
{
auto invoker = Queue1->GetInvoker();
- BIND([=] () {
+ BIND([=] {
auto promise = NewPromise<int>();
auto f2 = promise.ToFuture().ApplyUnique(BIND([] (TErrorOr<int>&& /*error*/) {
@@ -789,11 +789,11 @@ TEST_F(TSchedulerTest, CancelInAdjacentThread)
{
auto closure = TCallback<void(const TError&)>();
auto invoker = Queue1->GetInvoker();
- auto asyncResult1 = BIND([=, &closure] () {
+ auto asyncResult1 = BIND([=, &closure] {
closure = NYT::NConcurrency::GetCurrentFiberCanceler();
}).AsyncVia(invoker).Run().Get();
closure.Run(TError("Error")); // *evil laugh*
- auto asyncResult2 = BIND([=] () {
+ auto asyncResult2 = BIND([=] {
Yield();
}).AsyncVia(invoker).Run().Get();
closure.Reset(); // *evil smile*
@@ -810,7 +810,7 @@ TEST_F(TSchedulerTest, SerializedDoubleWaitFor)
auto promise = NewPromise<void>();
- BIND([&] () {
+ BIND([&] {
WaitFor(VoidFuture)
.ThrowOnError();
WaitFor(VoidFuture)
@@ -1167,7 +1167,7 @@ TEST_F(TSuspendableInvokerTest, PollSuspendFuture)
auto suspendableInvoker = CreateSuspendableInvoker(Queue1->GetInvoker());
- BIND([&] () {
+ BIND([&] {
Sleep(SleepQuantum * 10);
flag = true;
})
@@ -1193,7 +1193,7 @@ TEST_F(TSuspendableInvokerTest, SuspendableDoubleWaitFor)
auto promise = NewPromise<void>();
- auto setFlagFuture = BIND([&] () {
+ auto setFlagFuture = BIND([&] {
WaitFor(VoidFuture)
.ThrowOnError();
Sleep(SleepQuantum);
@@ -1232,7 +1232,7 @@ TEST_F(TSuspendableInvokerTest, EarlySuspend)
auto promise = NewPromise<void>();
- BIND([&] () {
+ BIND([&] {
promise.Set();
})
.Via(suspendableInvoker)
@@ -1248,7 +1248,7 @@ TEST_F(TSuspendableInvokerTest, ResumeBeforeFullSuspend)
{
auto suspendableInvoker = CreateSuspendableInvoker(Queue1->GetInvoker());
- BIND([&] () {
+ BIND([&] {
Sleep(SleepQuantum);
})
.Via(suspendableInvoker)
@@ -1269,7 +1269,7 @@ TEST_F(TSuspendableInvokerTest, AllowSuspendOnContextSwitch)
auto promise = NewPromise<void>();
auto future = promise.ToFuture();
- auto setFlagFuture = BIND([&] () {
+ auto setFlagFuture = BIND([&] {
Sleep(SleepQuantum);
WaitUntilSet(future);
flag = true;
@@ -1292,7 +1292,7 @@ TEST_F(TSuspendableInvokerTest, SuspendResumeOnFinishedRace)
std::atomic<bool> flag(false);
auto suspendableInvoker = CreateSuspendableInvoker(Queue1->GetInvoker());
- BIND([&] () {
+ BIND([&] {
for (int i = 0; i < 100; ++i) {
Sleep(TDuration::MilliSeconds(1));
Yield();
@@ -1305,7 +1305,7 @@ TEST_F(TSuspendableInvokerTest, SuspendResumeOnFinishedRace)
while (hits < 100) {
flag = false;
auto future = suspendableInvoker->Suspend()
- .Apply(BIND([=, &flag] () { flag = true; }));
+ .Apply(BIND([=, &flag] { flag = true; }));
if (future.IsSet()) {
++hits;
@@ -1327,14 +1327,14 @@ TEST_F(TSuspendableInvokerTest, ResumeInApply)
{
auto suspendableInvoker = CreateSuspendableInvoker(Queue1->GetInvoker());
- BIND([&] () {
+ BIND([&] {
Sleep(SleepQuantum);
})
.Via(suspendableInvoker)
.Run();
auto suspendFuture = suspendableInvoker->Suspend()
- .Apply(BIND([=] () { suspendableInvoker->Resume(); }));
+ .Apply(BIND([=] { suspendableInvoker->Resume(); }));
EXPECT_TRUE(suspendFuture.Get().IsOK());
}
@@ -1352,7 +1352,7 @@ TEST_F(TSuspendableInvokerTest, VerifySerializedActionsOrder)
std::atomic<int> reorderingCount = {0};
for (int i = 0; i < totalActionCount / 2; ++i) {
- BIND([&actionIndex, &reorderingCount, i] () {
+ BIND([&actionIndex, &reorderingCount, i] {
reorderingCount += (actionIndex != i);
++actionIndex;
})
@@ -1361,13 +1361,13 @@ TEST_F(TSuspendableInvokerTest, VerifySerializedActionsOrder)
}
TDelayedExecutor::Submit(
- BIND([&] () {
+ BIND([&] {
suspendableInvoker->Resume();
}),
SleepQuantum / 10);
for (int i = totalActionCount / 2; i < totalActionCount; ++i) {
- BIND([&actionIndex, &reorderingCount, i] () {
+ BIND([&actionIndex, &reorderingCount, i] {
reorderingCount += (actionIndex != i);
++actionIndex;
})
diff --git a/yt/yt/core/concurrency/unittests/throughput_throttler_ut.cpp b/yt/yt/core/concurrency/unittests/throughput_throttler_ut.cpp
index 8f8f283f90..ce9a313951 100644
--- a/yt/yt/core/concurrency/unittests/throughput_throttler_ut.cpp
+++ b/yt/yt/core/concurrency/unittests/throughput_throttler_ut.cpp
@@ -381,7 +381,7 @@ TEST_F(TPrefetchingThrottlerExponentialGrowthTest, DoNotOverloadUnderlyingWhenTh
EXPECT_CALL(*Underlying_, Throttle(_))
.Times(AtMost(9))
.WillRepeatedly(DoAll(
- [&] () { lastRequest = requests.emplace_back(NewPromise<void>()); },
+ [&] { lastRequest = requests.emplace_back(NewPromise<void>()); },
ReturnPointee(&lastRequest)
));
@@ -402,7 +402,7 @@ TEST_F(TPrefetchingThrottlerExponentialGrowthTest, DoNotHangUpAfterAnError)
EXPECT_CALL(*Underlying_, Throttle(_))
.Times(AtLeast(2))
.WillRepeatedly(DoAll(
- [&] () { lastRequest = requests.emplace_back(NewPromise<void>()); },
+ [&] { lastRequest = requests.emplace_back(NewPromise<void>()); },
ReturnPointee(&lastRequest)
));
@@ -496,7 +496,7 @@ TEST_P(TPrefetchingStressTest, Stress)
EXPECT_CALL(*Underlying_, Throttle(_))
.WillRepeatedly(DoAll(
SaveArg<0>(&lastUnderlyingAmount),
- [&] () {
+ [&] {
lastRequest = requests.emplace_back(NewPromise<void>());
++underlyingRequestCount;
iterationUnderlyingAmount += lastUnderlyingAmount;
@@ -504,7 +504,7 @@ TEST_P(TPrefetchingStressTest, Stress)
ReturnPointee(&lastRequest)
));
- auto processUnderlyingRequest = [&](double errorProbability) {
+ auto processUnderlyingRequest = [&] (double errorProbability) {
if (!requests.empty()) {
if (probabilisticOutcome(engine) < errorProbability) {
requests.front().Set(TError(NYT::EErrorCode::Generic, "Test error"));
diff --git a/yt/yt/core/crypto/tls.cpp b/yt/yt/core/crypto/tls.cpp
index 5da176043d..8144fb7ced 100644
--- a/yt/yt/core/crypto/tls.cpp
+++ b/yt/yt/core/crypto/tls.cpp
@@ -268,7 +268,7 @@ public:
{
auto promise = NewPromise<size_t>();
++ActiveIOCount_;
- Invoker_->Invoke(BIND([this, this_ = MakeStrong(this), promise, buffer] () {
+ Invoker_->Invoke(BIND([this, this_ = MakeStrong(this), promise, buffer] {
ReadBuffer_ = buffer;
ReadPromise_ = promise;
@@ -289,7 +289,7 @@ public:
{
auto promise = NewPromise<void>();
++ActiveIOCount_;
- Invoker_->Invoke(BIND([this, this_ = MakeStrong(this), promise, buffer] () {
+ Invoker_->Invoke(BIND([this, this_ = MakeStrong(this), promise, buffer] {
WriteBuffer_ = buffer;
WritePromise_ = promise;
@@ -316,7 +316,7 @@ public:
TFuture<void> Close() override
{
++ActiveIOCount_;
- return BIND([this, this_ = MakeStrong(this)] () {
+ return BIND([this, this_ = MakeStrong(this)] {
CloseRequested_ = true;
DoRun();
@@ -332,7 +332,7 @@ public:
TFuture<void> Abort() override
{
- return BIND([this, this_ = MakeStrong(this)] () {
+ return BIND([this, this_ = MakeStrong(this)] {
if (Error_.IsOK()) {
Error_ = TError("TLS connection aborted");
CheckError();
@@ -562,7 +562,7 @@ public:
TFuture<IConnectionPtr> Dial(const TNetworkAddress& remote, TDialerContextPtr context) override
{
return Underlying_->Dial(remote)
- .Apply(BIND([ctx = Ctx_, poller = Poller_, context = std::move(context)](const IConnectionPtr& underlying) -> IConnectionPtr {
+ .Apply(BIND([ctx = Ctx_, poller = Poller_, context = std::move(context)] (const IConnectionPtr& underlying) -> IConnectionPtr {
auto connection = New<TTlsConnection>(ctx, poller, underlying);
if (context != nullptr && context->Host != std::nullopt) {
connection->SetHost(*(context->Host));
diff --git a/yt/yt/core/http/retrying_client.cpp b/yt/yt/core/http/retrying_client.cpp
index 51e36cd9d7..50ece57066 100644
--- a/yt/yt/core/http/retrying_client.cpp
+++ b/yt/yt/core/http/retrying_client.cpp
@@ -179,7 +179,7 @@ private:
const TString& url,
Args&&... args)
{
- return BIND([=, this, this_ = MakeStrong(this), func = std::move(func), ...args = std::move(args)] () {
+ return BIND([=, this, this_ = MakeStrong(this), func = std::move(func), ...args = std::move(args)] {
return DoMakeRequest(std::move(func), responseChecker, url, std::forward<Args>(args)...);
}).AsyncVia(Invoker_).Run();
}
diff --git a/yt/yt/core/logging/zstd_compression.cpp b/yt/yt/core/logging/zstd_compression.cpp
index fe7a3306f5..a41d6ff3d6 100644
--- a/yt/yt/core/logging/zstd_compression.cpp
+++ b/yt/yt/core/logging/zstd_compression.cpp
@@ -80,7 +80,7 @@ public:
void Compress(const TBuffer& input, TBuffer& output) override
{
auto context = ZSTD_createCCtx();
- auto contextGuard = Finally([&] () {
+ auto contextGuard = Finally([&] {
ZSTD_freeCCtx(context);
});
diff --git a/yt/yt/core/misc/arithmetic_formula.cpp b/yt/yt/core/misc/arithmetic_formula.cpp
index 6aa84df465..fba6bab469 100644
--- a/yt/yt/core/misc/arithmetic_formula.cpp
+++ b/yt/yt/core/misc/arithmetic_formula.cpp
@@ -611,7 +611,7 @@ std::vector<TFormulaToken> TGenericFormulaImpl::Parse(
ThrowError(formula, position, message, context);
};
- auto finishSubformula = [&] () {
+ auto finishSubformula = [&] {
while (!stack.empty() && stack.back().Type != EFormulaTokenType::LeftBracket) {
result.push_back(stack.back());
stack.pop_back();
diff --git a/yt/yt/core/misc/fenwick_tree-inl.h b/yt/yt/core/misc/fenwick_tree-inl.h
index 095f016591..e41b2fd0ba 100644
--- a/yt/yt/core/misc/fenwick_tree-inl.h
+++ b/yt/yt/core/misc/fenwick_tree-inl.h
@@ -112,7 +112,7 @@ template <class TItem>
template <class TValue, class TComparer>
int TFenwickTree<TItem>::UpperBound(const TValue& sum, TComparer&& comparer) const
{
- return LowerBound(sum, [&comparer](const auto& lhs, const auto& rhs) {
+ return LowerBound(sum, [&comparer] (const auto& lhs, const auto& rhs) {
return !comparer(rhs, lhs);
});
}
diff --git a/yt/yt/core/misc/proc.cpp b/yt/yt/core/misc/proc.cpp
index a3b630383c..e757d73ffd 100644
--- a/yt/yt/core/misc/proc.cpp
+++ b/yt/yt/core/misc/proc.cpp
@@ -1616,7 +1616,7 @@ TFile MemfdCreate(const TString& name)
const TString& GetLinuxKernelVersion()
{
#ifdef _linux_
- static TString release = []() -> TString {
+ static TString release = [] () -> TString {
utsname buf{};
if (uname(&buf) != 0) {
return "unknown";
diff --git a/yt/yt/core/misc/unittests/arithmetic_formula_ut.cpp b/yt/yt/core/misc/unittests/arithmetic_formula_ut.cpp
index e1bdf8059d..b72b15d886 100644
--- a/yt/yt/core/misc/unittests/arithmetic_formula_ut.cpp
+++ b/yt/yt/core/misc/unittests/arithmetic_formula_ut.cpp
@@ -244,7 +244,7 @@ TEST(TArithmeticFormulaTest, Equality)
auto fn1 = MakeArithmeticFormula("1");
auto fn2 = MakeArithmeticFormula("2");
- auto assertComparison = [](const TArithmeticFormula& lhs, const TArithmeticFormula& rhs, bool equal) {
+ auto assertComparison = [] (const TArithmeticFormula& lhs, const TArithmeticFormula& rhs, bool equal) {
if (equal) {
EXPECT_TRUE(lhs == rhs);
EXPECT_EQ(lhs.GetHash(), rhs.GetHash());
diff --git a/yt/yt/core/misc/unittests/async_expiring_cache_ut.cpp b/yt/yt/core/misc/unittests/async_expiring_cache_ut.cpp
index 6fec652cd1..80a739d4b1 100644
--- a/yt/yt/core/misc/unittests/async_expiring_cache_ut.cpp
+++ b/yt/yt/core/misc/unittests/async_expiring_cache_ut.cpp
@@ -57,7 +57,7 @@ template <class T>
TFuture<T> MakeDelayedFuture(const TDuration& duration, T x)
{
return TDelayedExecutor::MakeDelayed(duration)
- .Apply(BIND([=] () { return x; }));
+ .Apply(BIND([=] { return x; }));
}
class TDelayedExpiringCache
@@ -116,7 +116,7 @@ TEST(TAsyncExpiringCacheTest, TestConcurrentAccess)
std::vector<TFuture<void>> asyncResult;
for (int i = 0; i < 10; ++i) {
- auto callback = BIND([=] () {
+ auto callback = BIND([=] {
for (int j = 0; j < 1000; ++j) {
YT_UNUSED_FUTURE(cache->Get(0));
diff --git a/yt/yt/core/misc/unittests/error_ut.cpp b/yt/yt/core/misc/unittests/error_ut.cpp
index 9b33cb935c..13c347be5c 100644
--- a/yt/yt/core/misc/unittests/error_ut.cpp
+++ b/yt/yt/core/misc/unittests/error_ut.cpp
@@ -832,7 +832,7 @@ TEST(TErrorTest, SimpleLoadAfterSave)
TEST(TErrorTest, AttributeSerialization)
{
- auto getWeededText = [](const TError& err) {
+ auto getWeededText = [] (const TError& err) {
std::vector<TString> lines;
for (const auto& line : StringSplitter(ToString(err)).Split('\n')) {
if (!line.Contains("origin") && !line.Contains("datetime")) {
diff --git a/yt/yt/core/misc/unittests/fenwick_tree_ut.cpp b/yt/yt/core/misc/unittests/fenwick_tree_ut.cpp
index c05552fd09..d72056985d 100644
--- a/yt/yt/core/misc/unittests/fenwick_tree_ut.cpp
+++ b/yt/yt/core/misc/unittests/fenwick_tree_ut.cpp
@@ -140,7 +140,7 @@ TEST(TFenwickTreeTest, TCustomStructureTest)
int X = 0;
int Y = 0;
- TItem() {}
+ TItem() = default;
TItem(int x, int y)
: X(x)
@@ -165,20 +165,20 @@ TEST(TFenwickTreeTest, TCustomStructureTest)
EXPECT_EQ(tree.GetCumulativeSum(2), TItem(3, 3));
- auto cmp = [](TItem lhs, TItem rhs) {
+ auto cmp = [] (TItem lhs, TItem rhs) {
return std::tie(lhs.X, lhs.Y) < std::tie(rhs.X, rhs.Y);
};
EXPECT_EQ(tree.LowerBound(TItem(1, 1), cmp), 1);
EXPECT_EQ(tree.UpperBound(TItem(1, 1), cmp), 2);
- auto cmpLower = [](TItem lhs, int rhs) {
+ auto cmpLower = [] (TItem lhs, int rhs) {
return lhs.X < rhs;
};
EXPECT_EQ(tree.LowerBound(1, cmpLower), 1);
- auto cmpUpper = [](int rhs, TItem lhs) {
+ auto cmpUpper = [] (int rhs, TItem lhs) {
return rhs < lhs.X;
};
diff --git a/yt/yt/core/misc/unittests/ref_counted_tracker_ut.cpp b/yt/yt/core/misc/unittests/ref_counted_tracker_ut.cpp
index faf1352a5b..e121b95197 100644
--- a/yt/yt/core/misc/unittests/ref_counted_tracker_ut.cpp
+++ b/yt/yt/core/misc/unittests/ref_counted_tracker_ut.cpp
@@ -123,7 +123,7 @@ TYPED_TEST_SUITE(TRefCountedTrackerTest, TypeList);
TYPED_TEST(TRefCountedTrackerTest, SinglethreadedRefCounted)
{
const auto instanceSize = TRefCountedTraits<TypeParam>::GetInstanceSize();
- auto create = [] () {
+ auto create = [] {
return TRefCountedTraits<TypeParam>::Create();
};
@@ -174,7 +174,7 @@ TYPED_TEST(TRefCountedTrackerTest, SinglethreadedRefCounted)
TYPED_TEST(TRefCountedTrackerTest, MultithreadedRefCounted)
{
const auto instanceSize = TRefCountedTraits<TypeParam>::GetInstanceSize();
- auto create = [] () {
+ auto create = [] {
return TRefCountedTraits<TypeParam>::Create();
};
@@ -184,7 +184,7 @@ TYPED_TEST(TRefCountedTrackerTest, MultithreadedRefCounted)
auto obj1 = create();
auto queue = New<TActionQueue>();
- BIND([&] () {
+ BIND([&] {
auto obj2 = create();
EXPECT_EQ(countBase + 2u, GetAllocatedCount<TypeParam>());
EXPECT_EQ(2u, GetAliveCount<TypeParam>());
diff --git a/yt/yt/core/misc/unittests/topological_ordering_ut.cpp b/yt/yt/core/misc/unittests/topological_ordering_ut.cpp
index 1c95aba99b..dee7e531d1 100644
--- a/yt/yt/core/misc/unittests/topological_ordering_ut.cpp
+++ b/yt/yt/core/misc/unittests/topological_ordering_ut.cpp
@@ -39,7 +39,8 @@ protected:
}
}
- void Clear() {
+ void Clear()
+ {
CurrentEdges_.clear();
IncrementalOrdering_ = TIncrementalTopologicalOrdering<int>();
}
diff --git a/yt/yt/core/net/address.cpp b/yt/yt/core/net/address.cpp
index e06ae312ff..97a9112816 100644
--- a/yt/yt/core/net/address.cpp
+++ b/yt/yt/core/net/address.cpp
@@ -545,11 +545,11 @@ bool ParseIP6Address(TStringBuf* str, TIP6Address* address)
auto words = address->GetRawWords();
std::fill_n(address->GetRawBytes(), TIP6Address::ByteSize, 0);
- auto isEnd = [&] () {
+ auto isEnd = [&] {
return str->empty() || (*str)[0] == '/';
};
- auto tokenizeAbbrev = [&] () {
+ auto tokenizeAbbrev = [&] {
if (str->size() >= 2 && (*str)[0] == ':' && (*str)[1] == ':') {
str->Skip(2);
return true;
@@ -709,7 +709,7 @@ void FormatValue(TStringBuilderBase* builder, const TIP6Address& address, TStrin
std::pair<int, int> maxRun = {-1, -1};
int start = -1;
int end = -1;
- auto endRun = [&] () {
+ auto endRun = [&] {
if ((end - start) >= (maxRun.second - maxRun.first) && (end - start) > 1) {
maxRun = {start, end};
}
diff --git a/yt/yt/core/rpc/grpc/server.cpp b/yt/yt/core/rpc/grpc/server.cpp
index 169bd8cb1e..013f21d258 100644
--- a/yt/yt/core/rpc/grpc/server.cpp
+++ b/yt/yt/core/rpc/grpc/server.cpp
@@ -354,7 +354,7 @@ private:
switch (cookie) {
case EServerCallCookie::Normal:
{
- const auto stage = [&] () {
+ const auto stage = [&] {
auto guard = Guard(SpinLock_);
return Stage_;
}();
diff --git a/yt/yt/core/rpc/server_detail.cpp b/yt/yt/core/rpc/server_detail.cpp
index bf8886478b..7164443d9c 100644
--- a/yt/yt/core/rpc/server_detail.cpp
+++ b/yt/yt/core/rpc/server_detail.cpp
@@ -973,7 +973,7 @@ TFuture<void> TServerBase::Stop(bool graceful)
YT_LOG_INFO("Stopping RPC server (Graceful: %v)",
graceful);
- return DoStop(graceful).Apply(BIND([this, this_ = MakeStrong(this)] () {
+ return DoStop(graceful).Apply(BIND([this, this_ = MakeStrong(this)] {
YT_LOG_INFO("RPC server stopped");
}));
}
diff --git a/yt/yt/core/rpc/stream.cpp b/yt/yt/core/rpc/stream.cpp
index cf1cc9ff93..ede479d0b8 100644
--- a/yt/yt/core/rpc/stream.cpp
+++ b/yt/yt/core/rpc/stream.cpp
@@ -528,7 +528,7 @@ TFuture<TSharedRef> TRpcClientInputStream::Read()
return MakeFuture(ref);
}
- return invokeResult.Apply(BIND([] () {
+ return invokeResult.Apply(BIND([] {
return TSharedRef();
}));
}));
@@ -639,7 +639,7 @@ TFuture<void> TRpcClientOutputStream::Write(const TSharedRef& data)
TFuture<void> TRpcClientOutputStream::Close()
{
CloseResult_.TrySetFrom(Underlying_->Close());
- return CloseResult_.ToFuture().Apply(BIND([invokeResult = InvokeResult_] () {
+ return CloseResult_.ToFuture().Apply(BIND([invokeResult = InvokeResult_] {
return invokeResult;
}));
}
diff --git a/yt/yt/core/yson/unittests/protobuf_yson_ut.cpp b/yt/yt/core/yson/unittests/protobuf_yson_ut.cpp
index e2550ea774..c355ae0979 100644
--- a/yt/yt/core/yson/unittests/protobuf_yson_ut.cpp
+++ b/yt/yt/core/yson/unittests/protobuf_yson_ut.cpp
@@ -1058,7 +1058,7 @@ TEST(TYsonToProtobufTest, CustomUnknownFieldsModeResolver)
// Basic usage of custom resolver with state.
TProtobufWriterOptions options;
int unknownKeyCount = 0;
- options.UnknownYsonFieldModeResolver = [&unknownKeyCount](const NYPath::TYPath& path) -> NYson::EUnknownYsonFieldsMode {
+ options.UnknownYsonFieldModeResolver = [&unknownKeyCount] (const NYPath::TYPath& path) -> NYson::EUnknownYsonFieldsMode {
if (path == "/nested_message1/nested_message/unknown_map") {
return NYson::EUnknownYsonFieldsMode::Forward;
} else if (path == "/nested_message1/nested_message/unknown_map/first_unknown_key" || path == "/nested_message1/nested_message/unknown_map/second_unknown_key") {
@@ -1131,7 +1131,7 @@ TEST(TYsonToProtobufTest, CustomUnknownFieldsModeResolver)
TString protobufString;
StringOutputStream protobufOutput(&protobufString);
TProtobufWriterOptions options;
- options.UnknownYsonFieldModeResolver = [](const NYPath::TYPath& path) -> NYson::EUnknownYsonFieldsMode {
+ options.UnknownYsonFieldModeResolver = [] (const NYPath::TYPath& path) -> NYson::EUnknownYsonFieldsMode {
if (path == "/unknown_map1") {
return NYson::EUnknownYsonFieldsMode::Forward;
}
@@ -1187,7 +1187,7 @@ TEST(TYsonToProtobufTest, CustomUnknownFieldsModeResolver)
}
{
TProtobufWriterOptions options;
- options.UnknownYsonFieldModeResolver = [](const NYPath::TYPath& path) -> NYson::EUnknownYsonFieldsMode {
+ options.UnknownYsonFieldModeResolver = [] (const NYPath::TYPath& path) -> NYson::EUnknownYsonFieldsMode {
if (path == "/nested_message1/unknown_map") {
return NYson::EUnknownYsonFieldsMode::Forward;
}
@@ -1215,7 +1215,7 @@ TEST(TYsonToProtobufTest, CustomUnknownFieldsModeResolver)
{
// Don't fail if Forward is returned on empty map or empty list.
TProtobufWriterOptions options;
- options.UnknownYsonFieldModeResolver = [](const NYPath::TYPath& path) -> NYson::EUnknownYsonFieldsMode {
+ options.UnknownYsonFieldModeResolver = [] (const NYPath::TYPath& path) -> NYson::EUnknownYsonFieldsMode {
if (path == "/nested_message1/unknown_map") {
return NYson::EUnknownYsonFieldsMode::Forward;
}
@@ -1248,7 +1248,7 @@ TEST(TYsonToProtobufTest, CustomUnknownFieldsModeResolver)
// Fail if leaf is scalar and returns Forward.
{
TProtobufWriterOptions options;
- options.UnknownYsonFieldModeResolver = [](const NYPath::TYPath& path) -> NYson::EUnknownYsonFieldsMode {
+ options.UnknownYsonFieldModeResolver = [] (const NYPath::TYPath& path) -> NYson::EUnknownYsonFieldsMode {
if (path == "/nested_message1/unknown_map") {
return NYson::EUnknownYsonFieldsMode::Forward;
}
@@ -1272,7 +1272,7 @@ TEST(TYsonToProtobufTest, CustomUnknownFieldsModeResolver)
{
// Fail on forwarded scalar value on the top level.
TProtobufWriterOptions options;
- options.UnknownYsonFieldModeResolver = [](const NYPath::TYPath& path) -> NYson::EUnknownYsonFieldsMode {
+ options.UnknownYsonFieldModeResolver = [] (const NYPath::TYPath& path) -> NYson::EUnknownYsonFieldsMode {
if (path == "/nested_message1/unknown_map") {
return NYson::EUnknownYsonFieldsMode::Forward;
}
@@ -1300,7 +1300,7 @@ TEST(TYsonToProtobufTest, CustomUnknownFieldsModeResolver)
}
{
TProtobufWriterOptions options;
- options.UnknownYsonFieldModeResolver = [](const NYPath::TYPath& path) -> NYson::EUnknownYsonFieldsMode {
+ options.UnknownYsonFieldModeResolver = [] (const NYPath::TYPath& path) -> NYson::EUnknownYsonFieldsMode {
if (path == "/nested_message1/unknown_map") {
return NYson::EUnknownYsonFieldsMode::Forward;
}
@@ -1368,7 +1368,7 @@ TEST(TYsonToProtobufTest, CustomUnknownFieldsModeResolver)
TString protobufString;
StringOutputStream protobufOutput(&protobufString);
TProtobufWriterOptions options;
- options.UnknownYsonFieldModeResolver = [](const NYPath::TYPath& path) -> NYson::EUnknownYsonFieldsMode {
+ options.UnknownYsonFieldModeResolver = [] (const NYPath::TYPath& path) -> NYson::EUnknownYsonFieldsMode {
if (path == "/nested_message1/unknown_map1") {
return NYson::EUnknownYsonFieldsMode::Forward;
}
@@ -1427,7 +1427,7 @@ TEST(TYsonToProtobufTest, CustomUnknownFieldsModeResolver)
}
{
TProtobufWriterOptions options;
- options.UnknownYsonFieldModeResolver = [](const NYPath::TYPath& path) {
+ options.UnknownYsonFieldModeResolver = [] (const NYPath::TYPath& path) {
if (path == "/forwarded_attr") {
return NYson::EUnknownYsonFieldsMode::Forward;
}
diff --git a/yt/yt/core/yson/unittests/yson_pull_parser_ut.cpp b/yt/yt/core/yson/unittests/yson_pull_parser_ut.cpp
index e03740e0de..33ae5d3924 100644
--- a/yt/yt/core/yson/unittests/yson_pull_parser_ut.cpp
+++ b/yt/yt/core/yson/unittests/yson_pull_parser_ut.cpp
@@ -145,7 +145,8 @@ public:
}
private:
- void NextBuffer() {
+ void NextBuffer()
+ {
if (Data_.empty()) {
CurrentInput_.reset();
} else {
diff --git a/yt/yt/core/ytree/unittests/yson_struct_ut.cpp b/yt/yt/core/ytree/unittests/yson_struct_ut.cpp
index b86a966d95..0337b098be 100644
--- a/yt/yt/core/ytree/unittests/yson_struct_ut.cpp
+++ b/yt/yt/core/ytree/unittests/yson_struct_ut.cpp
@@ -1544,7 +1544,7 @@ public:
static void Register(TRegistrar registrar)
{
registrar.Parameter("yson_struct", &TThis::YsonStruct)
- .DefaultCtor([] () { return CreateCustomDefault<TSimpleYsonStruct>(); });
+ .DefaultCtor([] { return CreateCustomDefault<TSimpleYsonStruct>(); });
}
};
diff --git a/yt/yt/core/ytree/ypath_client.cpp b/yt/yt/core/ytree/ypath_client.cpp
index d01b4a7859..ef2fbaf76c 100644
--- a/yt/yt/core/ytree/ypath_client.cpp
+++ b/yt/yt/core/ytree/ypath_client.cpp
@@ -593,7 +593,7 @@ void SetNodeByYPath(
TString currentToken;
TString currentLiteralValue;
- auto nextSegment = [&] () {
+ auto nextSegment = [&] {
tokenizer.Skip(NYPath::ETokenType::Ampersand);
tokenizer.Expect(NYPath::ETokenType::Slash);
tokenizer.Advance();
@@ -694,7 +694,7 @@ void ForceYPath(
TString currentToken;
TString currentLiteralValue;
- auto nextSegment = [&] () {
+ auto nextSegment = [&] {
tokenizer.Skip(NYPath::ETokenType::Ampersand);
tokenizer.Expect(NYPath::ETokenType::Slash);
tokenizer.Advance();
diff --git a/yt/yt/core/ytree/ypath_service.cpp b/yt/yt/core/ytree/ypath_service.cpp
index 96950cb16d..676d16824c 100644
--- a/yt/yt/core/ytree/ypath_service.cpp
+++ b/yt/yt/core/ytree/ypath_service.cpp
@@ -600,7 +600,7 @@ private:
bool DoInvoke(const IYPathServiceContextPtr& context) override
{
- Invoker_->Invoke(BIND([=, this, this_ = MakeStrong(this)] () {
+ Invoker_->Invoke(BIND([=, this, this_ = MakeStrong(this)] {
ExecuteVerb(UnderlyingService_, context);
}));
return true;
@@ -820,7 +820,7 @@ void ReplyErrorOrValue(const IYPathServiceContextPtr& context, const TErrorOr<TS
bool TCachedYPathService::DoInvoke(const IYPathServiceContextPtr& context)
{
if (IsCacheEnabled_ && IsCacheValid_) {
- WorkerInvoker_->Invoke(BIND([this, context, this_ = MakeStrong(this)]() {
+ WorkerInvoker_->Invoke(BIND([this, context, this_ = MakeStrong(this)] {
try {
auto cacheSnapshot = CurrentCacheSnapshot_.Acquire();
YT_VERIFY(cacheSnapshot);
diff --git a/yt/yt/core/ytree/yson_struct_detail-inl.h b/yt/yt/core/ytree/yson_struct_detail-inl.h
index de2050819b..8c02116c43 100644
--- a/yt/yt/core/ytree/yson_struct_detail-inl.h
+++ b/yt/yt/core/ytree/yson_struct_detail-inl.h
@@ -315,7 +315,7 @@ void LoadFromCursor(
try {
parameter.clear();
int index = 0;
- cursor->ParseList([&](NYson::TYsonPullParserCursor* cursor) {
+ cursor->ParseList([&] (NYson::TYsonPullParserCursor* cursor) {
LoadFromCursor(
parameter.emplace_back(),
cursor,
diff --git a/yt/yt/core/ytree/yson_struct_detail.cpp b/yt/yt/core/ytree/yson_struct_detail.cpp
index 83079749f9..12307266f5 100644
--- a/yt/yt/core/ytree/yson_struct_detail.cpp
+++ b/yt/yt/core/ytree/yson_struct_detail.cpp
@@ -71,7 +71,7 @@ IYsonStructParameterPtr TYsonStructMeta::GetParameter(const TString& keyOrAlias)
void TYsonStructMeta::LoadParameter(TYsonStructBase* target, const TString& key, const NYTree::INodePtr& node) const
{
const auto& parameter = GetParameter(key);
- auto validate = [&] () {
+ auto validate = [&] {
parameter->PostprocessParameter(target, "/" + key);
try {
for (const auto& postprocessor : Postprocessors_) {
diff --git a/yt/yt/library/decimal/unittests/decimal_ut.cpp b/yt/yt/library/decimal/unittests/decimal_ut.cpp
index f8827a3dbb..739d585276 100644
--- a/yt/yt/library/decimal/unittests/decimal_ut.cpp
+++ b/yt/yt/library/decimal/unittests/decimal_ut.cpp
@@ -155,7 +155,8 @@ class TDecimalWithPrecisionTest
, public ::testing::WithParamInterface<int>
{
public:
- static std::vector<int> GetAllPossiblePrecisions() {
+ static std::vector<int> GetAllPossiblePrecisions()
+ {
std::vector<int> result;
for (int i = 1; i <= TDecimal::MaxPrecision; ++i) {
result.push_back(i);
@@ -296,4 +297,4 @@ TEST_P(TDecimalWithPrecisionTest, TestBinaryValidation)
// Check -100..0
binaryValueDecrement(binBuffer, binValue.size());
EXPECT_THROW_WITH_SUBSTRING(TDecimal::ValidateBinaryValue(binValue, precision, 0), "does not have enough precision to represent");
-} \ No newline at end of file
+}
diff --git a/yt/yt/library/formats/protobuf_parser.cpp b/yt/yt/library/formats/protobuf_parser.cpp
index 5b3a575091..0df9018f0b 100644
--- a/yt/yt/library/formats/protobuf_parser.cpp
+++ b/yt/yt/library/formats/protobuf_parser.cpp
@@ -441,7 +441,7 @@ private:
{
const auto inRoot = (depth == 0);
- auto skipElements = [&](int count) {
+ auto skipElements = [&] (int count) {
if (inRoot) {
return;
}
@@ -484,7 +484,7 @@ private:
OutputChild(fieldRangeBegin, fieldIt, childDescription, depth);
lastOutputStructFieldIndex = structFieldIndex;
} else {
- auto isStructFieldPresentOrLegallyMissing = [&] () {
+ auto isStructFieldPresentOrLegallyMissing = [&] {
if (ShouldOutputValueImmediately(inRoot, childDescription)) {
if (RootChildOutputFlags_[childIndex]) {
// The value is already output.
diff --git a/yt/yt/library/formats/protobuf_writer.cpp b/yt/yt/library/formats/protobuf_writer.cpp
index 90be9baaba..d7e0d8001d 100644
--- a/yt/yt/library/formats/protobuf_writer.cpp
+++ b/yt/yt/library/formats/protobuf_writer.cpp
@@ -302,7 +302,7 @@ Y_FORCE_INLINE void WriteProtobufEnum(
extractor.ExtractEnum(&visitor, type);
- auto getEnumerationName = [&] () {
+ auto getEnumerationName = [&] {
return type->EnumerationDescription
? type->EnumerationDescription->GetEnumerationName()
: "<unknown>";
@@ -678,7 +678,7 @@ public:
int parentEmbeddingIndex = 0;
- std::function<int(int)> EmitMessage = [&](int parentEmbeddingIndex) {
+ std::function<int(int)> EmitMessage = [&] (int parentEmbeddingIndex) {
auto& embeddingDescription = embeddings[parentEmbeddingIndex];
auto& blob = EmbeddedBuffers[parentEmbeddingIndex];
diff --git a/yt/yt/library/formats/schemaful_dsv_writer.cpp b/yt/yt/library/formats/schemaful_dsv_writer.cpp
index 17b9210ff9..60f5c9e803 100644
--- a/yt/yt/library/formats/schemaful_dsv_writer.cpp
+++ b/yt/yt/library/formats/schemaful_dsv_writer.cpp
@@ -102,7 +102,7 @@ public:
: -1)
{
BlobOutput_ = GetOutputStream();
- WriteColumnNamesHeader([this](TStringBuf buf, char c) {
+ WriteColumnNamesHeader([this] (TStringBuf buf, char c) {
WriteRaw(buf);
WriteRaw(c);
});
@@ -186,7 +186,7 @@ public:
IdToIndexInRow)
, Output_(CreateBufferedSyncAdapter(stream))
{
- WriteColumnNamesHeader([this](TStringBuf buf, char c) {
+ WriteColumnNamesHeader([this] (TStringBuf buf, char c) {
Output_->Write(buf);
Output_->Write(c);
});
diff --git a/yt/yt/library/formats/skiff_yson_converter.cpp b/yt/yt/library/formats/skiff_yson_converter.cpp
index e7d1d899ef..24164556bf 100644
--- a/yt/yt/library/formats/skiff_yson_converter.cpp
+++ b/yt/yt/library/formats/skiff_yson_converter.cpp
@@ -1030,11 +1030,11 @@ TYsonToSkiffConverter CreateStructYsonToSkiffConverter(
const TConverterCreationContext& context,
const TYsonToSkiffConverterConfig& config)
{
- TYsonToSkiffConverter skipYsonValue = [](TYsonPullParserCursor* cursor, TCheckedInDebugSkiffWriter* /*writer*/) {
+ TYsonToSkiffConverter skipYsonValue = [] (TYsonPullParserCursor* cursor, TCheckedInDebugSkiffWriter* /*writer*/) {
cursor->SkipComplexValue();
};
- TYsonToSkiffConverter writeNullUnknownField = [](TYsonPullParserCursor*, TCheckedInDebugSkiffWriter* writer) {
+ TYsonToSkiffConverter writeNullUnknownField = [] (TYsonPullParserCursor*, TCheckedInDebugSkiffWriter* writer) {
writer->WriteVariant8Tag(0);
};
@@ -1088,7 +1088,7 @@ TYsonToSkiffConverter CreateTupleYsonToSkiffConverter(
const TConverterCreationContext& context,
const TYsonToSkiffConverterConfig& config)
{
- TYsonToSkiffConverter skipYsonValue = [](TYsonPullParserCursor* cursor, TCheckedInDebugSkiffWriter* /*writer*/) {
+ TYsonToSkiffConverter skipYsonValue = [] (TYsonPullParserCursor* cursor, TCheckedInDebugSkiffWriter* /*writer*/) {
cursor->SkipComplexValue();
};
@@ -1154,7 +1154,7 @@ public:
static_assert(wireType == EWireType::Variant16);
writer->WriteVariant16Tag(tag);
}
- ConverterList_[tag](cursor, writer);
+ ConverterList_[tag] (cursor, writer);
if (cursor->GetCurrent().GetType() != EYsonItemType::EndList) {
ThrowBadYsonToken(Descriptor_, {EYsonItemType::EndList}, cursor->GetCurrent().GetType());
}
@@ -1610,7 +1610,7 @@ TSkiffToYsonConverter CreateListSkiffToYsonConverter(
auto match = MatchListTypes(descriptor, skiffSchema);
auto innerConverter = CreateSkiffToYsonConverterImpl(std::move(match.first), match.second, context, config);
- return [innerConverter = innerConverter, descriptor=std::move(descriptor)](TCheckedInDebugSkiffParser* parser, TCheckedInDebugYsonTokenWriter* writer) {
+ return [innerConverter = innerConverter, descriptor=std::move(descriptor)] (TCheckedInDebugSkiffParser* parser, TCheckedInDebugYsonTokenWriter* writer) {
writer->WriteBeginList();
while (true) {
auto tag = parser->ParseVariant8Tag();
@@ -1636,7 +1636,7 @@ TSkiffToYsonConverter CreateStructSkiffToYsonConverter(
const TConverterCreationContext& context,
const TSkiffToYsonConverterConfig& config)
{
- const auto insertEntity = [](TCheckedInDebugSkiffParser* /*parser*/, TCheckedInDebugYsonTokenWriter* writer) {
+ const auto insertEntity = [] (TCheckedInDebugSkiffParser* /*parser*/, TCheckedInDebugYsonTokenWriter* writer) {
writer->WriteEntity();
};
@@ -1658,7 +1658,7 @@ TSkiffToYsonConverter CreateStructSkiffToYsonConverter(
}
}
- return [converterList = converterList](TCheckedInDebugSkiffParser* parser, TCheckedInDebugYsonTokenWriter* writer) {
+ return [converterList = converterList] (TCheckedInDebugSkiffParser* parser, TCheckedInDebugYsonTokenWriter* writer) {
writer->WriteBeginList();
for (const auto& converter : converterList) {
converter(parser, writer);
@@ -1679,7 +1679,7 @@ TSkiffToYsonConverter CreateTupleSkiffToYsonConverter(
for (const auto& [fieldDescriptor, fieldSkiffSchema] : tupleMatch) {
converterList.emplace_back(CreateSkiffToYsonConverterImpl(fieldDescriptor, fieldSkiffSchema, context, config));
}
- return [converterList = converterList](TCheckedInDebugSkiffParser* parser, TCheckedInDebugYsonTokenWriter* writer) {
+ return [converterList = converterList] (TCheckedInDebugSkiffParser* parser, TCheckedInDebugYsonTokenWriter* writer) {
writer->WriteBeginList();
for (const auto& converter : converterList) {
converter(parser, writer);
diff --git a/yt/yt/library/numeric/algorithm_helpers-inl.h b/yt/yt/library/numeric/algorithm_helpers-inl.h
index ea04df3a32..980fccb5c3 100644
--- a/yt/yt/library/numeric/algorithm_helpers-inl.h
+++ b/yt/yt/library/numeric/algorithm_helpers-inl.h
@@ -129,7 +129,7 @@ void PartialShuffle(TIter begin, TIter end, TIter last)
template <class T, class TGetKey>
std::pair<const T&, const T&> MinMaxBy(const T& first, const T& second, const TGetKey& getKey)
{
- return std::minmax(first, second, [&](auto&& left, auto&& right) { return getKey(left) < getKey(right); });
+ return std::minmax(first, second, [&] (auto&& left, auto&& right) { return getKey(left) < getKey(right); });
}
////////////////////////////////////////////////////////////////////////////////
diff --git a/yt/yt/library/process/process.cpp b/yt/yt/library/process/process.cpp
index dba02116e9..49836d3d1e 100644
--- a/yt/yt/library/process/process.cpp
+++ b/yt/yt/library/process/process.cpp
@@ -377,7 +377,7 @@ TFuture<void> TProcessBase::Spawn()
void TSimpleProcess::DoSpawn()
{
#ifdef _unix_
- auto finally = Finally([&] () {
+ auto finally = Finally([&] {
StdPipes_[STDIN_FILENO].CloseReadFD();
StdPipes_[STDOUT_FILENO].CloseWriteFD();
StdPipes_[STDERR_FILENO].CloseWriteFD();
@@ -433,7 +433,7 @@ void TSimpleProcess::DoSpawn()
if (!WorkingDirectory_.empty()) {
SpawnActions_.push_back(TSpawnAction{
- [&] () {
+ [&] {
NFs::SetCurrentWorkingDirectory(WorkingDirectory_);
return true;
},
@@ -443,7 +443,7 @@ void TSimpleProcess::DoSpawn()
if (CreateProcessGroup_) {
SpawnActions_.push_back(TSpawnAction{
- [&] () {
+ [&] {
setpgrp();
return true;
},
diff --git a/yt/yt/library/process/unittests/pipes_ut.cpp b/yt/yt/library/process/unittests/pipes_ut.cpp
index f8eba17da2..4200e38915 100644
--- a/yt/yt/library/process/unittests/pipes_ut.cpp
+++ b/yt/yt/library/process/unittests/pipes_ut.cpp
@@ -359,7 +359,7 @@ TEST_P(TPipeBigReadWriteTest, RealReadWrite)
std::vector<char> data(dataSize, 'a');
- YT_UNUSED_FUTURE(BIND([&] () {
+ YT_UNUSED_FUTURE(BIND([&] {
auto dice = std::bind(
std::uniform_int_distribution<int>(0, 127),
std::default_random_engine());
diff --git a/yt/yt/library/process/unittests/process_ut.cpp b/yt/yt/library/process/unittests/process_ut.cpp
index 55f7fc65c8..01a1468e59 100644
--- a/yt/yt/library/process/unittests/process_ut.cpp
+++ b/yt/yt/library/process/unittests/process_ut.cpp
@@ -183,7 +183,7 @@ TEST(TProcessTest, Kill)
auto finished = p->Spawn();
NConcurrency::TDelayedExecutor::Submit(
- BIND([&] () {
+ BIND([&] {
p->Kill(SIGKILL);
}),
TDuration::MilliSeconds(100));
diff --git a/yt/yt/library/process/unittests/subprocess_ut.cpp b/yt/yt/library/process/unittests/subprocess_ut.cpp
index 932d250784..32120a89a6 100644
--- a/yt/yt/library/process/unittests/subprocess_ut.cpp
+++ b/yt/yt/library/process/unittests/subprocess_ut.cpp
@@ -43,7 +43,7 @@ TEST(TSubprocessTest, PipeStdin)
{
auto queue = New<TActionQueue>();
- BIND([] () {
+ BIND([] {
TSubprocess subprocess("/bin/cat");
subprocess.AddArgument("-");
@@ -61,7 +61,7 @@ TEST(TSubprocessTest, PipeBigOutput)
{
auto queue = New<TActionQueue>();
- auto result = BIND([] () {
+ auto result = BIND([] {
TSubprocess subprocess("/bin/bash");
subprocess.AddArgument("-c");
@@ -79,7 +79,7 @@ TEST(TSubprocessTest, PipeBigError)
{
auto queue = New<TActionQueue>();
- auto result = BIND([] () {
+ auto result = BIND([] {
TSubprocess subprocess("/bin/bash");
subprocess.AddArgument("-c");
diff --git a/yt/yt/library/profiling/perf/counters.cpp b/yt/yt/library/profiling/perf/counters.cpp
index e9f2ee2c61..f5f5455725 100644
--- a/yt/yt/library/profiling/perf/counters.cpp
+++ b/yt/yt/library/profiling/perf/counters.cpp
@@ -227,7 +227,7 @@ void EnablePerfCounters()
auto exportCounter = [&] (const TString& category, const TString& name, EPerfEventType type) {
try {
owner->Counters.emplace_back(new TPerfEventCounter{type});
- TProfiler{category}.AddFuncCounter(name, owner, [counter=owner->Counters.back().get()] () {
+ TProfiler{category}.AddFuncCounter(name, owner, [counter=owner->Counters.back().get()] {
return counter->Read();
});
} catch (const std::exception&) {
diff --git a/yt/yt/library/profiling/solomon/registry.cpp b/yt/yt/library/profiling/solomon/registry.cpp
index 09ed420105..4b65c3c2d0 100644
--- a/yt/yt/library/profiling/solomon/registry.cpp
+++ b/yt/yt/library/profiling/solomon/registry.cpp
@@ -40,7 +40,7 @@ ICounterImplPtr TSolomonRegistry::RegisterCounter(
TSensorOptions options)
{
return SelectImpl<ICounterImpl, TSimpleCounter, TPerCpuCounter>(options.Hot, [&, this] (const auto& counter) {
- DoRegister([this, name, tags, options = std::move(options), counter] () {
+ DoRegister([this, name, tags, options = std::move(options), counter] {
auto reader = [ptr = counter.Get()] {
return ptr->GetValue();
};
@@ -59,7 +59,7 @@ ITimeCounterImplPtr TSolomonRegistry::RegisterTimeCounter(
return SelectImpl<ITimeCounterImpl, TSimpleTimeCounter, TPerCpuTimeCounter>(
options.Hot,
[&, this] (const auto& counter) {
- DoRegister([this, name, tags, options = std::move(options), counter] () {
+ DoRegister([this, name, tags, options = std::move(options), counter] {
auto set = FindSet(name, options);
set->AddTimeCounter(New<TTimeCounterState>(counter, Tags_.Encode(tags), tags));
});
@@ -76,7 +76,7 @@ IGaugeImplPtr TSolomonRegistry::RegisterGauge(
gauge->Update(std::numeric_limits<double>::quiet_NaN());
}
- DoRegister([this, name, tags, options = std::move(options), gauge] () {
+ DoRegister([this, name, tags, options = std::move(options), gauge] {
auto reader = [ptr = gauge.Get()] {
return ptr->GetValue();
};
@@ -94,7 +94,7 @@ ITimeGaugeImplPtr TSolomonRegistry::RegisterTimeGauge(
{
auto gauge = New<TSimpleTimeGauge>();
- DoRegister([this, name, tags, options = std::move(options), gauge] () {
+ DoRegister([this, name, tags, options = std::move(options), gauge] {
auto reader = [ptr = gauge.Get()] {
return ptr->GetValue().SecondsFloat();
};
@@ -112,7 +112,7 @@ ISummaryImplPtr TSolomonRegistry::RegisterSummary(
TSensorOptions options)
{
return SelectImpl<ISummaryImpl, TSimpleSummary<double>, TPerCpuSummary<double>>(options.Hot, [&, this] (const auto& summary) {
- DoRegister([this, name, tags, options = std::move(options), summary] () {
+ DoRegister([this, name, tags, options = std::move(options), summary] {
auto set = FindSet(name, options);
set->AddSummary(New<TSummaryState>(summary, Tags_.Encode(tags), tags));
});
@@ -125,7 +125,7 @@ IGaugeImplPtr TSolomonRegistry::RegisterGaugeSummary(
TSensorOptions options)
{
auto gauge = New<TSimpleGauge>();
- DoRegister([this, name, tags, options = std::move(options), gauge] () {
+ DoRegister([this, name, tags, options = std::move(options), gauge] {
auto set = FindSet(name, options);
set->AddSummary(New<TSummaryState>(gauge, Tags_.Encode(tags), tags));
});
@@ -139,7 +139,7 @@ ITimeGaugeImplPtr TSolomonRegistry::RegisterTimeGaugeSummary(
TSensorOptions options)
{
auto gauge = New<TSimpleTimeGauge>();
- DoRegister([this, name, tags, options = std::move(options), gauge] () {
+ DoRegister([this, name, tags, options = std::move(options), gauge] {
auto set = FindSet(name, options);
set->AddTimerSummary(New<TTimerSummaryState>(gauge, Tags_.Encode(tags), tags));
});
@@ -155,7 +155,7 @@ ITimerImplPtr TSolomonRegistry::RegisterTimerSummary(
return SelectImpl<ITimerImpl, TSimpleSummary<TDuration>, TPerCpuSummary<TDuration>>(
options.Hot,
[&, this] (const auto& timer) {
- DoRegister([this, name, tags, options = std::move(options), timer] () {
+ DoRegister([this, name, tags, options = std::move(options), timer] {
auto set = FindSet(name, options);
set->AddTimerSummary(New<TTimerSummaryState>(timer, Tags_.Encode(tags), tags));
});
@@ -168,7 +168,7 @@ ITimerImplPtr TSolomonRegistry::RegisterTimeHistogram(
TSensorOptions options)
{
auto hist = New<THistogram>(options);
- DoRegister([this, name, tags, options = std::move(options), hist] () {
+ DoRegister([this, name, tags, options = std::move(options), hist] {
auto set = FindSet(name, options);
set->AddTimeHistogram(New<THistogramState>(hist, Tags_.Encode(tags), tags));
});
@@ -181,7 +181,7 @@ IHistogramImplPtr TSolomonRegistry::RegisterGaugeHistogram(
TSensorOptions options)
{
auto hist = New<THistogram>(options);
- DoRegister([this, name, tags, options = std::move(options), hist] () {
+ DoRegister([this, name, tags, options = std::move(options), hist] {
auto set = FindSet(name, options);
set->AddGaugeHistogram(New<THistogramState>(hist, Tags_.Encode(tags), tags));
});
@@ -194,7 +194,7 @@ IHistogramImplPtr TSolomonRegistry::RegisterRateHistogram(
TSensorOptions options)
{
auto hist = New<THistogram>(options);
- DoRegister([this, name, tags, options = std::move(options), hist] () {
+ DoRegister([this, name, tags, options = std::move(options), hist] {
auto set = FindSet(name, options);
set->AddRateHistogram(New<THistogramState>(hist, Tags_.Encode(tags), tags));
});
@@ -208,7 +208,7 @@ void TSolomonRegistry::RegisterFuncCounter(
const TRefCountedPtr& owner,
std::function<i64()> reader)
{
- DoRegister([this, name, tags, options = std::move(options), owner, reader] () {
+ DoRegister([this, name, tags, options = std::move(options), owner, reader] {
auto set = FindSet(name, options);
set->AddCounter(New<TCounterState>(owner, reader, Tags_.Encode(tags), tags));
});
@@ -221,7 +221,7 @@ void TSolomonRegistry::RegisterFuncGauge(
const TRefCountedPtr& owner,
std::function<double()> reader)
{
- DoRegister([this, name, tags, options = std::move(options), owner, reader] () {
+ DoRegister([this, name, tags, options = std::move(options), owner, reader] {
auto set = FindSet(name, options);
set->AddGauge(New<TGaugeState>(owner, reader, Tags_.Encode(tags), tags));
});
@@ -233,7 +233,7 @@ void TSolomonRegistry::RegisterProducer(
TSensorOptions options,
const ISensorProducerPtr& producer)
{
- DoRegister([this, prefix, tags, options = std::move(options), producer] () {
+ DoRegister([this, prefix, tags, options = std::move(options), producer] {
Producers_.AddProducer(New<TProducerState>(prefix, tags, options, producer));
});
}
diff --git a/yt/yt/library/profiling/unittests/deps/main.cpp b/yt/yt/library/profiling/unittests/deps/main.cpp
index ac20c4df89..65e02e9149 100644
--- a/yt/yt/library/profiling/unittests/deps/main.cpp
+++ b/yt/yt/library/profiling/unittests/deps/main.cpp
@@ -7,7 +7,8 @@ using namespace NYT::NProfiling;
////////////////////////////////////////////////////////////////////////////////
-int main() {
+int main()
+{
NYT::NProfiling::TProfiler profiler{"/foo"};
auto gauge = profiler.Gauge("/bar");
gauge.Update(1.0);
diff --git a/yt/yt/library/program/config.cpp b/yt/yt/library/program/config.cpp
index 9e9437bddb..b5b05c16f0 100644
--- a/yt/yt/library/program/config.cpp
+++ b/yt/yt/library/program/config.cpp
@@ -84,7 +84,7 @@ void TSingletonsConfig::Register(TRegistrar registrar)
registrar.Parameter("solomon_exporter", &TThis::SolomonExporter)
.DefaultNew();
registrar.Parameter("logging", &TThis::Logging)
- .DefaultCtor([] () { return NLogging::TLogManagerConfig::CreateDefault(); });
+ .DefaultCtor([] { return NLogging::TLogManagerConfig::CreateDefault(); });
registrar.Parameter("jaeger", &TThis::Jaeger)
.DefaultNew();
registrar.Parameter("tracing_transport", &TThis::TracingTransport)
diff --git a/yt/yt/library/tracing/jaeger/tracer.cpp b/yt/yt/library/tracing/jaeger/tracer.cpp
index dec77c7f90..574c59add3 100644
--- a/yt/yt/library/tracing/jaeger/tracer.cpp
+++ b/yt/yt/library/tracing/jaeger/tracer.cpp
@@ -440,7 +440,7 @@ void TJaegerTracer::DequeueAll(const TJaegerTracerConfigPtr& config)
}
THashMap<TString, NProto::Batch> batches;
- auto flushBatch = [&](TString endpoint) {
+ auto flushBatch = [&] (TString endpoint) {
auto itBatch = batches.find(endpoint);
if (itBatch == batches.end()) {
return;
diff --git a/yt/yt/library/ytprof/cpu_profiler.cpp b/yt/yt/library/ytprof/cpu_profiler.cpp
index e04aefa424..3e64ea3836 100644
--- a/yt/yt/library/ytprof/cpu_profiler.cpp
+++ b/yt/yt/library/ytprof/cpu_profiler.cpp
@@ -183,7 +183,7 @@ TCpuProfilerOptions::TSampleFilter GetActionMinExecTimeFilter(TDuration minExecT
{
auto minCpuDuration = DurationToCpuDuration(minExecTime);
- return [minCpuDuration] () {
+ return [minCpuDuration] {
auto fiberStartTime = GetTraceContextTimingCheckpoint();
if (fiberStartTime == 0) {
return false;