Browse Source

Restoring authorship annotation for <nosyrev@yandex-team.ru>. Commit 2 of 2.

nosyrev 3 years ago
parent
commit
a34560e505

+ 1 - 1
build/scripts/mkdir.py

@@ -3,7 +3,7 @@ import os
 import sys
 
 
-def mkdir_p(directory): 
+def mkdir_p(directory):
     if not os.path.exists(directory):
         os.makedirs(directory)
 

+ 1 - 1
library/cpp/enumbitset/enumbitset.cpp

@@ -1 +1 @@
-#include "enumbitset.h" 
+#include "enumbitset.h"

+ 29 - 29
library/cpp/enumbitset/enumbitset.h

@@ -12,14 +12,14 @@
 // @end value is not included in the mask and is not necessarily defined as enum value.
 // For example: enum EType { A, B, C } ==> TEnumBitSet<EType, A, C + 1>
 template <typename TEnum, int mbegin, int mend>
-class TEnumBitSet: private TBitMap<mend - mbegin> { 
+class TEnumBitSet: private TBitMap<mend - mbegin> {
 public:
     static const int BeginIndex = mbegin;
     static const int EndIndex = mend;
     static const size_t BitsetSize = EndIndex - BeginIndex;
 
     typedef TBitMap<BitsetSize> TParent;
-    typedef TEnumBitSet<TEnum, mbegin, mend> TThis; 
+    typedef TEnumBitSet<TEnum, mbegin, mend> TThis;
 
     TEnumBitSet()
         : TParent(0)
@@ -348,14 +348,14 @@ public:
         return Count();
     }
 
-    class TIterator { 
-    public: 
+    class TIterator {
+    public:
         TIterator(TEnum value, const TThis* bitmap) noexcept
             : Value(static_cast<int>(value))
-            , BitMap(bitmap) 
-        { 
-        } 
- 
+            , BitMap(bitmap)
+        {
+        }
+
         TIterator(const TThis* bitmap) noexcept
             : Value(EndIndex)
             , BitMap(bitmap)
@@ -364,13 +364,13 @@ public:
 
         TEnum operator*() const noexcept {
             Y_ASSERT(Value < EndIndex);
-            return static_cast<TEnum>(Value); 
-        } 
- 
+            return static_cast<TEnum>(Value);
+        }
+
         bool operator!=(const TIterator& other) const noexcept {
-            return Value != other.Value; 
-        } 
- 
+            return Value != other.Value;
+        }
+
         TIterator& operator++() noexcept {
             Y_ASSERT(Value < EndIndex);
             TEnum res;
@@ -381,22 +381,22 @@ public:
             }
 
             return *this;
-        } 
- 
-    private: 
-        int Value; 
-        const TThis* BitMap; 
-    }; 
- 
-    TIterator begin() const { 
+        }
+
+    private:
+        int Value;
+        const TThis* BitMap;
+    };
+
+    TIterator begin() const {
         TEnum res;
         return FindFirst(res) ? TIterator(res, this) : TIterator(this);
-    } 
- 
-    TIterator end() const { 
+    }
+
+    TIterator end() const {
         return TIterator(this);
-    } 
- 
+    }
+
 private:
     static size_t Pos(TEnum c) {
         Y_ASSERT(IsValid(c));
@@ -432,10 +432,10 @@ private:
     }
 };
 
-template <typename TEnum, TEnum mbegin, int mend> 
+template <typename TEnum, TEnum mbegin, int mend>
 class TSfEnumBitSet: public TEnumBitSet<TEnum, mbegin, mend> {
 public:
-    typedef TEnumBitSet<TEnum, mbegin, mend> TParent; 
+    typedef TEnumBitSet<TEnum, mbegin, mend> TParent;
 
     TSfEnumBitSet()
         : TParent()

+ 64 - 64
library/cpp/enumbitset/enumbitset_ut.cpp

@@ -1,41 +1,41 @@
-#include "enumbitset.h" 
- 
+#include "enumbitset.h"
+
 #include <library/cpp/testing/unittest/registar.h>
- 
-#include <util/stream/str.h> 
-#include <util/stream/file.h> 
- 
-enum ETestEnum { 
-    TE_FIRST = 0, 
-    TE_1, 
-    TE_2, 
-    TE_3, 
-    TE_4, 
-    TE_MIDDLE = TE_4 + 64, 
-    TE_5, 
-    TE_6, 
-    TE_7, 
-    TE_MAX, 
- 
-    TE_OVERFLOW, // to test overflow 
-}; 
+
+#include <util/stream/str.h>
+#include <util/stream/file.h>
+
+enum ETestEnum {
+    TE_FIRST = 0,
+    TE_1,
+    TE_2,
+    TE_3,
+    TE_4,
+    TE_MIDDLE = TE_4 + 64,
+    TE_5,
+    TE_6,
+    TE_7,
+    TE_MAX,
+
+    TE_OVERFLOW, // to test overflow
+};
 using TTestBitSet = TEnumBitSet<ETestEnum, TE_FIRST, TE_MAX>;
- 
+
 Y_UNIT_TEST_SUITE(TEnumBitSetTest) {
     Y_UNIT_TEST(TestMainFunctions) {
-        auto ebs = TTestBitSet(TE_FIRST, TE_MIDDLE); 
- 
-        UNIT_ASSERT(ebs.SafeTest(TE_FIRST)); 
-        UNIT_ASSERT(ebs.SafeTest(TE_MIDDLE)); 
- 
-        ebs.SafeSet(TE_5); 
-        UNIT_ASSERT(ebs.SafeTest(TE_5)); 
-        UNIT_ASSERT(!ebs.SafeTest(TE_7)); 
- 
-        ebs.SafeSet(TE_OVERFLOW); 
-        UNIT_ASSERT(!ebs.SafeTest(TE_OVERFLOW)); 
+        auto ebs = TTestBitSet(TE_FIRST, TE_MIDDLE);
+
+        UNIT_ASSERT(ebs.SafeTest(TE_FIRST));
+        UNIT_ASSERT(ebs.SafeTest(TE_MIDDLE));
+
+        ebs.SafeSet(TE_5);
+        UNIT_ASSERT(ebs.SafeTest(TE_5));
+        UNIT_ASSERT(!ebs.SafeTest(TE_7));
+
+        ebs.SafeSet(TE_OVERFLOW);
+        UNIT_ASSERT(!ebs.SafeTest(TE_OVERFLOW));
     }
- 
+
     Y_UNIT_TEST(TestEmpty) {
         TTestBitSet mask;
         UNIT_ASSERT(mask.Empty());
@@ -47,37 +47,37 @@ Y_UNIT_TEST_SUITE(TEnumBitSetTest) {
         UNIT_ASSERT(mask.Count() == 1);
         if (!mask)
             UNIT_ASSERT(false && "should not be empty");
-    } 
- 
+    }
+
     Y_UNIT_TEST(TestIter) {
-        TTestBitSet mask = TTestBitSet(TE_1, TE_3, TE_7); 
- 
-        TTestBitSet mask2; 
-        for (auto elem : mask) { 
-            mask2.Set(elem); 
-        } 
- 
-        UNIT_ASSERT(mask == mask2); 
-    } 
- 
+        TTestBitSet mask = TTestBitSet(TE_1, TE_3, TE_7);
+
+        TTestBitSet mask2;
+        for (auto elem : mask) {
+            mask2.Set(elem);
+        }
+
+        UNIT_ASSERT(mask == mask2);
+    }
+
     Y_UNIT_TEST(TestSerialization) {
-        auto ebs = TTestBitSet(TE_MIDDLE, TE_6, TE_7); 
- 
-        TStringStream ss; 
-        ebs.Save(&ss); 
- 
-        auto ebs2 = TTestBitSet(); 
-        ebs2.Load(&ss); 
-        UNIT_ASSERT_EQUAL(ebs, ebs2); 
-    } 
- 
+        auto ebs = TTestBitSet(TE_MIDDLE, TE_6, TE_7);
+
+        TStringStream ss;
+        ebs.Save(&ss);
+
+        auto ebs2 = TTestBitSet();
+        ebs2.Load(&ss);
+        UNIT_ASSERT_EQUAL(ebs, ebs2);
+    }
+
     Y_UNIT_TEST(TestStringRepresentation) {
-        auto ebs = TTestBitSet(TE_MIDDLE, TE_6, TE_7); 
- 
-        UNIT_ASSERT_EQUAL(ebs.ToString(), "D00000000000000000"); 
- 
-        auto ebs2 = TTestBitSet(); 
-        ebs2.FromString("D00000000000000000"); 
-        UNIT_ASSERT_EQUAL(ebs, ebs2); 
-    } 
-} 
+        auto ebs = TTestBitSet(TE_MIDDLE, TE_6, TE_7);
+
+        UNIT_ASSERT_EQUAL(ebs.ToString(), "D00000000000000000");
+
+        auto ebs2 = TTestBitSet();
+        ebs2.FromString("D00000000000000000");
+        UNIT_ASSERT_EQUAL(ebs, ebs2);
+    }
+}

+ 8 - 8
library/cpp/enumbitset/ut/ya.make

@@ -1,9 +1,9 @@
 UNITTEST_FOR(library/cpp/enumbitset)
- 
-OWNER(alzobnin) 
- 
-SRCS( 
-    enumbitset_ut.cpp 
-) 
- 
-END() 
+
+OWNER(alzobnin)
+
+SRCS(
+    enumbitset_ut.cpp
+)
+
+END()

+ 8 - 8
library/cpp/enumbitset/ya.make

@@ -1,9 +1,9 @@
-LIBRARY() 
- 
+LIBRARY()
+
 OWNER(alzobnin)
- 
-SRCS( 
-    enumbitset.cpp 
-) 
- 
-END() 
+
+SRCS(
+    enumbitset.cpp
+)
+
+END()

+ 1 - 1
library/cpp/lcs/README.md

@@ -28,6 +28,6 @@ The idea of the algorithm for constructing DS:
 - Going along the original sequence, for the current member x in the list of its DS we find the leftmost, such that its last term is not less than x.
 - If there is one, then add x to the end.
 - If not, add a new DS consisting of x to the DS list.
- 
+
 It can be shown that the DS list constructed this way will be SC.
 

+ 3 - 3
tools/ya.make

@@ -27,7 +27,7 @@ RECURSE(
     directindexer
     doc_handle_decode
     doc_handle_decode/ut
-    doc_url_index_print 
+    doc_url_index_print
     dolbilo
     domschemec
     domschemec/ut
@@ -78,7 +78,7 @@ RECURSE(
     mstand
     mtime0
     mx_bin2info
-    nehc 
+    nehc
     nlp_test
     nodeiter_test
     nodeiter_test/tests
@@ -115,7 +115,7 @@ RECURSE(
     python-netconfig-static
     qlz
     query_marker_builder
-    queryrectest 
+    queryrectest
     queryrectest/tests
     queryrectest/tests/data
     rcgtest