Browse Source

Restoring authorship annotation for <a-square@yandex-team.ru>. Commit 1 of 2.

a-square 3 years ago
parent
commit
34f3f9bd79

+ 16 - 16
library/cpp/json/json_writer.h

@@ -156,22 +156,22 @@ namespace NJson {
             // nothing to do
         }
 
-        void WriteKey(const TStringBuf key) {
-            Buf.WriteKey(key);
-        }
-
-        void WriteKey(const unsigned char* key) {
-            WriteKey((const char*)key);
-        }
-
-        void WriteKey(const char* key) {
-            WriteKey(TStringBuf{key});
-        }
-
-        void WriteKey(const TString& key) {
-            WriteKey(TStringBuf{key});
-        }
-
+        void WriteKey(const TStringBuf key) { 
+            Buf.WriteKey(key); 
+        } 
+ 
+        void WriteKey(const unsigned char* key) { 
+            WriteKey((const char*)key); 
+        } 
+ 
+        void WriteKey(const char* key) { 
+            WriteKey(TStringBuf{key}); 
+        } 
+ 
+        void WriteKey(const TString& key) { 
+            WriteKey(TStringBuf{key}); 
+        } 
+ 
         void WriteKey(const std::string& key) {
             WriteKey(TStringBuf{key});
         }

+ 2 - 2
library/cpp/json/ut/json_writer_ut.cpp

@@ -16,8 +16,8 @@ Y_UNIT_TEST_SUITE(TJsonWriterTest) {
         TJsonWriter json(&out, false);
         json.OpenMap();
         json.Write("key1", (ui16)1);
-        json.WriteKey("key2");
-        json.Write((i32)2);
+        json.WriteKey("key2"); 
+        json.Write((i32)2); 
         json.Write("key3", (ui64)3);
 
         UNIT_ASSERT(out.Empty());

+ 8 - 8
util/digest/sequence_ut.cpp

@@ -1,7 +1,7 @@
 #include "sequence.h"
 
 #include <library/cpp/testing/unittest/registar.h>
-#include <util/generic/map.h>
+#include <util/generic/map.h> 
 #include <util/generic/vector.h>
 
 class TRangeHashTest: public TTestBase {
@@ -9,7 +9,7 @@ class TRangeHashTest: public TTestBase {
     UNIT_TEST(TestStrokaInt)
     UNIT_TEST(TestIntVector)
     UNIT_TEST(TestOneElement)
-    UNIT_TEST(TestMap);
+    UNIT_TEST(TestMap); 
     UNIT_TEST(TestCollectionIndependancy);
     UNIT_TEST_SUITE_END();
 
@@ -31,12 +31,12 @@ private:
         UNIT_ASSERT_UNEQUAL(THash<int>()(testVal), TRangeHash<>()(testVec));
     }
 
-    inline void TestMap() {
-        const size_t canonicalHash = static_cast<size_t>(ULL(4415387926488545605));
-        TMap<TString, int> testMap{{"foo", 123}, {"bar", 456}};
-        UNIT_ASSERT_EQUAL(canonicalHash, TRangeHash<>()(testMap));
-    }
-
+    inline void TestMap() { 
+        const size_t canonicalHash = static_cast<size_t>(ULL(4415387926488545605)); 
+        TMap<TString, int> testMap{{"foo", 123}, {"bar", 456}}; 
+        UNIT_ASSERT_EQUAL(canonicalHash, TRangeHash<>()(testMap)); 
+    } 
+ 
     inline void TestCollectionIndependancy() {
         TVector<char> testVec = {'a', 'b', 'c'};
         TString testStroka = "abc";

+ 3 - 3
util/generic/buffer.h

@@ -29,9 +29,9 @@ public:
     TBuffer& operator=(TBuffer&& b) noexcept;
 
     TBuffer& operator=(const TBuffer& b) {
-        if (this != &b) {
-            Assign(b.Data(), b.Size());
-        }
+        if (this != &b) { 
+            Assign(b.Data(), b.Size()); 
+        } 
         return *this;
     }
 

+ 1 - 1
util/generic/flags.h

@@ -39,7 +39,7 @@ public:
     using TEnum = Enum;
     using TInt = std::underlying_type_t<Enum>;
 
-    constexpr TFlags(std::nullptr_t = 0)
+    constexpr TFlags(std::nullptr_t = 0) 
         : Value_(0)
     {
     }

+ 4 - 4
util/str_stl.h

@@ -168,10 +168,10 @@ namespace NHashPrivate {
     struct TPairHash<TFirst, TSecond, true> {
         template <class T>
         inline size_t operator()(const T& pair) const {
-            // maps have TFirst = const TFoo, which would make for an undefined specialization
-            using TFirstClean = std::remove_cv_t<TFirst>;
-            using TSecondClean = std::remove_cv_t<TSecond>;
-            return CombineHashes(THash<TFirstClean>()(pair.first), THash<TSecondClean>()(pair.second));
+            // maps have TFirst = const TFoo, which would make for an undefined specialization 
+            using TFirstClean = std::remove_cv_t<TFirst>; 
+            using TSecondClean = std::remove_cv_t<TSecond>; 
+            return CombineHashes(THash<TFirstClean>()(pair.first), THash<TSecondClean>()(pair.second)); 
         }
     };
 }

+ 29 - 29
util/stream/buffered.cpp

@@ -36,32 +36,32 @@ public:
     }
 
     inline size_t Skip(size_t len) {
-        size_t totalSkipped = 0;
-        while (len) {
-            const size_t skipped = DoSkip(len);
-            if (skipped == 0) {
-                break;
-            }
-
-            totalSkipped += skipped;
-            len -= skipped;
+        size_t totalSkipped = 0; 
+        while (len) { 
+            const size_t skipped = DoSkip(len); 
+            if (skipped == 0) { 
+                break; 
+            } 
+ 
+            totalSkipped += skipped; 
+            len -= skipped; 
         }
-
-        return totalSkipped;
-    }
-
-    inline size_t DoSkip(size_t len) {
-        if (MemInput_.Exhausted()) {
-            if (len > BufLen() / 2) {
-                return Slave_->Skip(len);
-            }
-
-            MemInput_.Reset(Buf(), Slave_->Read(Buf(), BufLen()));
-        }
-
-        return MemInput_.Skip(len);
+ 
+        return totalSkipped; 
     }
 
+    inline size_t DoSkip(size_t len) { 
+        if (MemInput_.Exhausted()) { 
+            if (len > BufLen() / 2) { 
+                return Slave_->Skip(len); 
+            } 
+ 
+            MemInput_.Reset(Buf(), Slave_->Read(Buf(), BufLen())); 
+        } 
+ 
+        return MemInput_.Skip(len); 
+    } 
+ 
     inline size_t ReadTo(TString& st, char to) {
         st.clear();
 
@@ -122,9 +122,9 @@ TBufferedInput::TBufferedInput(IInputStream* slave, size_t buflen)
 {
 }
 
-TBufferedInput::TBufferedInput(TBufferedInput&&) noexcept = default;
-TBufferedInput& TBufferedInput::operator=(TBufferedInput&&) noexcept = default;
-
+TBufferedInput::TBufferedInput(TBufferedInput&&) noexcept = default; 
+TBufferedInput& TBufferedInput::operator=(TBufferedInput&&) noexcept = default; 
+ 
 TBufferedInput::~TBufferedInput() = default;
 
 size_t TBufferedInput::DoRead(void* buf, size_t len) {
@@ -356,9 +356,9 @@ TBufferedOutputBase::TBufferedOutputBase(IOutputStream* slave, size_t buflen)
 {
 }
 
-TBufferedOutputBase::TBufferedOutputBase(TBufferedOutputBase&&) noexcept = default;
-TBufferedOutputBase& TBufferedOutputBase::operator=(TBufferedOutputBase&&) noexcept = default;
-
+TBufferedOutputBase::TBufferedOutputBase(TBufferedOutputBase&&) noexcept = default; 
+TBufferedOutputBase& TBufferedOutputBase::operator=(TBufferedOutputBase&&) noexcept = default; 
+ 
 TBufferedOutputBase::~TBufferedOutputBase() {
     try {
         Finish();

+ 6 - 6
util/stream/buffered.h

@@ -23,10 +23,10 @@
 class TBufferedInput: public IZeroCopyInput {
 public:
     TBufferedInput(IInputStream* slave, size_t buflen = 8192);
-
-    TBufferedInput(TBufferedInput&&) noexcept;
-    TBufferedInput& operator=(TBufferedInput&&) noexcept;
-
+ 
+    TBufferedInput(TBufferedInput&&) noexcept; 
+    TBufferedInput& operator=(TBufferedInput&&) noexcept; 
+ 
     ~TBufferedInput() override;
 
     /**
@@ -79,8 +79,8 @@ public:
      */
     TBufferedOutputBase(IOutputStream* slave, size_t buflen);
 
-    TBufferedOutputBase(TBufferedOutputBase&&) noexcept;
-    TBufferedOutputBase& operator=(TBufferedOutputBase&&) noexcept;
+    TBufferedOutputBase(TBufferedOutputBase&&) noexcept; 
+    TBufferedOutputBase& operator=(TBufferedOutputBase&&) noexcept; 
 
     ~TBufferedOutputBase() override;
 

+ 6 - 6
util/string/ascii.cpp

@@ -7,12 +7,12 @@
 extern const unsigned char NPrivate::ASCII_CLASS[256] = {
     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00,
     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x01, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
-    0x68, 0x68, 0x68, 0x68, 0x68, 0x68, 0x68, 0x68, 0x68, 0x68, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
-    0x80, 0x72, 0x72, 0x72, 0x72, 0x72, 0x72, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32,
-    0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x80, 0x80, 0x80, 0x80, 0x80,
-    0x80, 0x74, 0x74, 0x74, 0x74, 0x74, 0x74, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34,
-    0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x80, 0x80, 0x80, 0x80, 0x00,
+    0x01, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 
+    0x68, 0x68, 0x68, 0x68, 0x68, 0x68, 0x68, 0x68, 0x68, 0x68, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 
+    0x80, 0x72, 0x72, 0x72, 0x72, 0x72, 0x72, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 
+    0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x80, 0x80, 0x80, 0x80, 0x80, 
+    0x80, 0x74, 0x74, 0x74, 0x74, 0x74, 0x74, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 
+    0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x80, 0x80, 0x80, 0x80, 0x00, 
     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

+ 11 - 11
util/string/ascii.h

@@ -19,8 +19,8 @@ namespace NPrivate {
         CC_DIGIT = 8,
         CC_ALPHA = 16,
         CC_ALNUM = 32,
-        CC_ISHEX = 64,
-        CC_PUNCT = 128,
+        CC_ISHEX = 64, 
+        CC_PUNCT = 128, 
     };
 
     extern const unsigned char ASCII_CLASS[256];
@@ -92,10 +92,10 @@ inline bool IsAsciiHex(unsigned char c) {
     return ::NPrivate::ASCII_CLASS[c] & ::NPrivate::CC_ISHEX;
 }
 
-inline bool IsAsciiPunct(unsigned char c) {
-    return ::NPrivate::ASCII_CLASS[c] & ::NPrivate::CC_PUNCT;
-}
-
+inline bool IsAsciiPunct(unsigned char c) { 
+    return ::NPrivate::ASCII_CLASS[c] & ::NPrivate::CC_PUNCT; 
+} 
+ 
 // some overloads
 
 template <class T>
@@ -133,11 +133,11 @@ inline bool IsAsciiHex(T c) {
     return ::NPrivate::RangeOk(c) && IsAsciiHex(static_cast<unsigned char>(c));
 }
 
-template <class T>
-inline bool IsAsciiPunct(T c) {
-    return ::NPrivate::RangeOk(c) && IsAsciiPunct(static_cast<unsigned char>(c));
-}
-
+template <class T> 
+inline bool IsAsciiPunct(T c) { 
+    return ::NPrivate::RangeOk(c) && IsAsciiPunct(static_cast<unsigned char>(c)); 
+} 
+ 
 // some extra helpers
 inline ui8 AsciiToLower(ui8 c) noexcept {
     return ::NPrivate::ASCII_LOWER[c];

Some files were not shown because too many files changed in this diff