aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorqkrorlqr <qkrorlqr@yandex-team.ru>2022-02-10 16:47:21 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:47:21 +0300
commiteec632e483ae34bc211138c67434b1e0e6054ced (patch)
tree9814fbd1c3effac9b8377c5d604b367b14e2db55 /util
parent9b89266638b10d40309e31dcb7caa2fc52b2aefd (diff)
downloadydb-eec632e483ae34bc211138c67434b1e0e6054ced.tar.gz
Restoring authorship annotation for <qkrorlqr@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util')
-rw-r--r--util/generic/scope.cpp2
-rw-r--r--util/generic/scope.h12
-rw-r--r--util/generic/scope_ut.cpp22
3 files changed, 18 insertions, 18 deletions
diff --git a/util/generic/scope.cpp b/util/generic/scope.cpp
index 5efa7cb0d2..c70d695c1b 100644
--- a/util/generic/scope.cpp
+++ b/util/generic/scope.cpp
@@ -1 +1 @@
-#include "scope.h"
+#include "scope.h"
diff --git a/util/generic/scope.h b/util/generic/scope.h
index 7d4d0c7faf..b2c33af61e 100644
--- a/util/generic/scope.h
+++ b/util/generic/scope.h
@@ -1,10 +1,10 @@
-#pragma once
-
+#pragma once
+
#include <util/system/compiler.h>
-#include <util/system/defaults.h>
+#include <util/system/defaults.h>
#include <utility>
-
+
namespace NPrivate {
template <typename F>
class TScopeGuard {
@@ -13,12 +13,12 @@ namespace NPrivate {
: Function_{function}
{
}
-
+
TScopeGuard(F&& function)
: Function_{std::move(function)}
{
}
-
+
TScopeGuard(TScopeGuard&&) = default;
TScopeGuard(const TScopeGuard&) = default;
diff --git a/util/generic/scope_ut.cpp b/util/generic/scope_ut.cpp
index 43cec8daca..bdb434d487 100644
--- a/util/generic/scope_ut.cpp
+++ b/util/generic/scope_ut.cpp
@@ -1,13 +1,13 @@
-#include "scope.h"
-
+#include "scope.h"
+
#include <util/generic/ptr.h>
#include <library/cpp/testing/unittest/registar.h>
-
+
Y_UNIT_TEST_SUITE(ScopeToolsTest) {
Y_UNIT_TEST(OnScopeExitTest) {
- int i = 0;
-
- {
+ int i = 0;
+
+ {
Y_SCOPE_EXIT(&i) {
i = i * 2;
};
@@ -15,10 +15,10 @@ Y_UNIT_TEST_SUITE(ScopeToolsTest) {
Y_SCOPE_EXIT(&i) {
i = i + 1;
};
- }
-
- UNIT_ASSERT_VALUES_EQUAL(2, i);
- }
+ }
+
+ UNIT_ASSERT_VALUES_EQUAL(2, i);
+ }
Y_UNIT_TEST(OnScopeExitMoveTest) {
THolder<int> i{new int{10}};
@@ -44,4 +44,4 @@ Y_UNIT_TEST_SUITE(ScopeToolsTest) {
UNIT_ASSERT_VALUES_EQUAL(i, 20);
}
-}
+}