aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp
diff options
context:
space:
mode:
authoregoregor <egoregor@yandex-team.ru>2022-02-10 16:50:28 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:50:28 +0300
commitd2ba528d19d736bd3424ea63017a589baef70154 (patch)
tree3caa96b1b89d2c8abfd7b136464521060eeeba9d /library/cpp
parent9d0e9c90c05aacc70c91ef99d5b4724af73a591f (diff)
downloadydb-d2ba528d19d736bd3424ea63017a589baef70154.tar.gz
Restoring authorship annotation for <egoregor@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp')
-rw-r--r--library/cpp/histogram/adaptive/fixed_bin_histogram.cpp8
-rw-r--r--library/cpp/messagebus/locator.cpp2
-rw-r--r--library/cpp/messagebus/locator.h2
-rw-r--r--library/cpp/messagebus/test/ut/locator_uniq_ut.cpp56
4 files changed, 34 insertions, 34 deletions
diff --git a/library/cpp/histogram/adaptive/fixed_bin_histogram.cpp b/library/cpp/histogram/adaptive/fixed_bin_histogram.cpp
index 558aba9e2d..c8d33b9d55 100644
--- a/library/cpp/histogram/adaptive/fixed_bin_histogram.cpp
+++ b/library/cpp/histogram/adaptive/fixed_bin_histogram.cpp
@@ -496,10 +496,10 @@ namespace NKiwiAggr {
}
double TFixedBinHistogram::CalcDensity(double value) {
- i32 bin = CalcBin(value);
- if (bin < 0 || bin >= (i32)Freqs.size() || BinRange == 0.0 || GetSum() == 0) {
- return 0.0;
- }
+ i32 bin = CalcBin(value);
+ if (bin < 0 || bin >= (i32)Freqs.size() || BinRange == 0.0 || GetSum() == 0) {
+ return 0.0;
+ }
return Freqs[bin] / GetSum() / BinRange;
}
diff --git a/library/cpp/messagebus/locator.cpp b/library/cpp/messagebus/locator.cpp
index e38a35c426..59241be3f4 100644
--- a/library/cpp/messagebus/locator.cpp
+++ b/library/cpp/messagebus/locator.cpp
@@ -129,7 +129,7 @@ namespace NBus {
return true;
}
}
-
+
return false;
}
diff --git a/library/cpp/messagebus/locator.h b/library/cpp/messagebus/locator.h
index f8556a3fce..148595b9ee 100644
--- a/library/cpp/messagebus/locator.h
+++ b/library/cpp/messagebus/locator.h
@@ -40,7 +40,7 @@ namespace NBus {
TItem(TServiceId serviceId, TBusKey start, TBusKey end, const TNetAddr& addr);
};
-
+
typedef TMultiSet<TItem> TItems;
TItems Items;
TMutex Lock;
diff --git a/library/cpp/messagebus/test/ut/locator_uniq_ut.cpp b/library/cpp/messagebus/test/ut/locator_uniq_ut.cpp
index 3fdd175d73..be44a119d2 100644
--- a/library/cpp/messagebus/test/ut/locator_uniq_ut.cpp
+++ b/library/cpp/messagebus/test/ut/locator_uniq_ut.cpp
@@ -1,40 +1,40 @@
#include <library/cpp/testing/unittest/registar.h>
-
+
#include <library/cpp/messagebus/test_utils.h>
#include <library/cpp/messagebus/ybus.h>
-class TLocatorRegisterUniqTest: public TTestBase {
+class TLocatorRegisterUniqTest: public TTestBase {
UNIT_TEST_SUITE(TLocatorRegisterUniqTest);
UNIT_TEST(TestRegister);
UNIT_TEST_SUITE_END();
-
+
protected:
void TestRegister();
-};
-
-UNIT_TEST_SUITE_REGISTRATION(TLocatorRegisterUniqTest);
-
-void TLocatorRegisterUniqTest::TestRegister() {
+};
+
+UNIT_TEST_SUITE_REGISTRATION(TLocatorRegisterUniqTest);
+
+void TLocatorRegisterUniqTest::TestRegister() {
ASSUME_IP_V4_ENABLED;
- NBus::TBusLocator locator;
- const char* serviceName = "TestService";
- const char* hostName = "192.168.0.42";
- int port = 31337;
-
- NBus::TBusKeyVec keys;
- locator.LocateKeys(serviceName, keys);
- UNIT_ASSERT(keys.size() == 0);
-
- locator.Register(serviceName, hostName, port);
- locator.LocateKeys(serviceName, keys);
- /// YBUS_KEYMIN YBUS_KEYMAX range
- UNIT_ASSERT(keys.size() == 1);
-
+ NBus::TBusLocator locator;
+ const char* serviceName = "TestService";
+ const char* hostName = "192.168.0.42";
+ int port = 31337;
+
+ NBus::TBusKeyVec keys;
+ locator.LocateKeys(serviceName, keys);
+ UNIT_ASSERT(keys.size() == 0);
+
+ locator.Register(serviceName, hostName, port);
+ locator.LocateKeys(serviceName, keys);
+ /// YBUS_KEYMIN YBUS_KEYMAX range
+ UNIT_ASSERT(keys.size() == 1);
+
TVector<NBus::TNetAddr> hosts;
- UNIT_ASSERT(locator.LocateAll(serviceName, NBus::YBUS_KEYMIN, hosts) == 1);
-
- locator.Register(serviceName, hostName, port);
- hosts.clear();
- UNIT_ASSERT(locator.LocateAll(serviceName, NBus::YBUS_KEYMIN, hosts) == 1);
-}
+ UNIT_ASSERT(locator.LocateAll(serviceName, NBus::YBUS_KEYMIN, hosts) == 1);
+
+ locator.Register(serviceName, hostName, port);
+ hosts.clear();
+ UNIT_ASSERT(locator.LocateAll(serviceName, NBus::YBUS_KEYMIN, hosts) == 1);
+}