diff options
author | alexeykruglov <alexeykruglov@yandex-team.ru> | 2022-02-10 16:45:38 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:38 +0300 |
commit | f64e95a9eb9ab03240599eb9581c5a9102426a96 (patch) | |
tree | b2cc84ee7850122e7ccf51d0ea21e4fa7e7a5685 /util | |
parent | 06361c53c4ca58f57007ea73fc399fc25664f13c (diff) | |
download | ydb-f64e95a9eb9ab03240599eb9581c5a9102426a96.tar.gz |
Restoring authorship annotation for <alexeykruglov@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util')
-rw-r--r-- | util/charset/wide.cpp | 12 | ||||
-rw-r--r-- | util/charset/wide.h | 2 | ||||
-rw-r--r-- | util/charset/wide_ut.cpp | 20 | ||||
-rw-r--r-- | util/generic/ptr.h | 10 | ||||
-rw-r--r-- | util/generic/refcount.h | 14 | ||||
-rw-r--r-- | util/network/iovec.h | 2 | ||||
-rw-r--r-- | util/network/socket.cpp | 62 | ||||
-rw-r--r-- | util/string/vector.h | 4 | ||||
-rw-r--r-- | util/system/fs.cpp | 4 |
9 files changed, 65 insertions, 65 deletions
diff --git a/util/charset/wide.cpp b/util/charset/wide.cpp index 49f49f5110..a287438ddd 100644 --- a/util/charset/wide.cpp +++ b/util/charset/wide.cpp @@ -580,7 +580,7 @@ void EscapeHtmlChars(TUtf16String& str) { const TUtf16String& cs = str; for (size_t i = 0; i < cs.size(); ++i) - escapedLen += EscapedLen<insertBr>(cs[i]); + escapedLen += EscapedLen<insertBr>(cs[i]); if (escapedLen == cs.size()) return; @@ -606,11 +606,11 @@ void EscapeHtmlChars(TUtf16String& str) { ent = " break; default: - if (insertBr && (cs[i] == '\r' || cs[i] == '\n')) { - ent = &br; - break; - } else - continue; + if (insertBr && (cs[i] == '\r' || cs[i] == '\n')) { + ent = &br; + break; + } else + continue; } res.append(cs.begin() + start, cs.begin() + i); diff --git a/util/charset/wide.h b/util/charset/wide.h index 1c23c8b4ec..04e6928aab 100644 --- a/util/charset/wide.h +++ b/util/charset/wide.h @@ -808,7 +808,7 @@ TUtf32String ToUpperRet(const TUtf32StringBuf text, size_t pos = 0, size_t count TUtf32String ToTitleRet(const TUtf32StringBuf text, size_t pos = 0, size_t count = TWtringBuf::npos) Y_WARN_UNUSED_RESULT; //! replaces the '<', '>' and '&' characters in string with '<', '>' and '&' respectively -// insertBr=true - replace '\r' and '\n' with "<BR>" +// insertBr=true - replace '\r' and '\n' with "<BR>" template <bool insertBr> void EscapeHtmlChars(TUtf16String& str); diff --git a/util/charset/wide_ut.cpp b/util/charset/wide_ut.cpp index d20bde8f0d..d8f3233e73 100644 --- a/util/charset/wide_ut.cpp +++ b/util/charset/wide_ut.cpp @@ -809,9 +809,9 @@ public: void TestEscapeHtmlChars() { // characters from the first half of the ASCII table - for (wchar16 c = 1; c < 0x7F; ++c) { + for (wchar16 c = 1; c < 0x7F; ++c) { TUtf16String w(1, c); - EscapeHtmlChars<false>(w); + EscapeHtmlChars<false>(w); switch (c) { case '<': @@ -831,12 +831,12 @@ public: break; } } - - for (wchar16 c = 1; c < 0x7F; ++c) { + + for (wchar16 c = 1; c < 0x7F; ++c) { TUtf16String w(1, c); - EscapeHtmlChars<true>(w); - - switch (c) { + EscapeHtmlChars<true>(w); + + switch (c) { case '<': UNIT_ASSERT(w == ASCIIToWide("<")); break; @@ -856,10 +856,10 @@ public: default: UNIT_ASSERT(w == TUtf16String(1, c)); break; - } - } + } + } } - + void TestToLower() { const size_t n = 32; wchar16 upperCase[n]; diff --git a/util/generic/ptr.h b/util/generic/ptr.h index 9127163c1c..19db0e3ec5 100644 --- a/util/generic/ptr.h +++ b/util/generic/ptr.h @@ -31,16 +31,16 @@ template <class T> inline void CheckedDelete(T* t) { AssertTypeComplete<T>(); - delete t; -} - + delete t; +} + template <class T> inline void CheckedArrayDelete(T* t) { AssertTypeComplete<T>(); delete[] t; -} - +} + class TNoAction { public: template <class T> diff --git a/util/generic/refcount.h b/util/generic/refcount.h index 558e6c3cbe..966e853b77 100644 --- a/util/generic/refcount.h +++ b/util/generic/refcount.h @@ -3,7 +3,7 @@ #include <util/system/guard.h> #include <util/system/atomic.h> #include <util/system/defaults.h> -#include <util/system/yassert.h> +#include <util/system/yassert.h> template <class TCounterCheckPolicy> class TSimpleCounterTemplate: public TCounterCheckPolicy { @@ -55,14 +55,14 @@ public: private: TAtomicBase Counter_; }; - + class TNoCheckPolicy { protected: inline void Check() const { } }; -#if defined(SIMPLE_COUNTER_THREAD_CHECK) +#if defined(SIMPLE_COUNTER_THREAD_CHECK) #include <util/system/thread.i> @@ -71,18 +71,18 @@ public: inline TCheckPolicy() { ThreadId = SystemCurrentThreadId(); } - + protected: inline void Check() const { Y_VERIFY(ThreadId == SystemCurrentThreadId(), "incorrect usage of TSimpleCounter"); } - + private: size_t ThreadId; }; -#else +#else using TCheckPolicy = TNoCheckPolicy; -#endif +#endif // Use this one if access from multiple threads to your pointer is an error and you want to enforce thread checks using TSimpleCounter = TSimpleCounterTemplate<TCheckPolicy>; diff --git a/util/network/iovec.h b/util/network/iovec.h index 52d873137c..ac15a41f54 100644 --- a/util/network/iovec.h +++ b/util/network/iovec.h @@ -50,7 +50,7 @@ public: return ret; } - + inline size_t Bytes() const noexcept { return Bytes(Parts_, Count_); } diff --git a/util/network/socket.cpp b/util/network/socket.cpp index be74562f19..4f6e804346 100644 --- a/util/network/socket.cpp +++ b/util/network/socket.cpp @@ -38,7 +38,7 @@ #include <util/string/cast.h> #include <util/stream/mem.h> #include <util/system/datetime.h> -#include <util/system/error.h> +#include <util/system/error.h> #include <util/memory/tempbuf.h> #include <util/generic/singleton.h> #include <util/generic/hash_set.h> @@ -782,23 +782,23 @@ public: return ret; } - + ssize_t SendV(SOCKET fd, const TPart* parts, size_t count) override { ssize_t ret = SendVImpl(fd, parts, count); - + if (ret < 0) { return ret; } - + size_t len = TContIOVector::Bytes(parts, count); - + if ((size_t)ret == len) { return ret; } - + return SendVPartial(fd, parts, count, ret); } - + inline ssize_t SendVImpl(SOCKET fd, const TPart* parts, size_t count) { return TSender < (sizeof(iovec) == sizeof(TPart)) && (offsetof(iovec, iov_base) == offsetof(TPart, buf)) && (offsetof(iovec, iov_len) == offsetof(TPart, len)) > ::SendV(fd, parts, count); } @@ -806,32 +806,32 @@ public: ssize_t SendVPartial(SOCKET fd, const TPart* constParts, size_t count, size_t written); }; -ssize_t TCommonSockOps::SendVPartial(SOCKET fd, const TPart* constParts, size_t count, size_t written) { - TTempBuf tempbuf(sizeof(TPart) * count); - TPart* parts = (TPart*)tempbuf.Data(); - - for (size_t i = 0; i < count; ++i) { - parts[i] = constParts[i]; - } - - TContIOVector vec(parts, count); - vec.Proceed(written); - - while (!vec.Complete()) { - ssize_t ret = SendVImpl(fd, vec.Parts(), vec.Count()); - +ssize_t TCommonSockOps::SendVPartial(SOCKET fd, const TPart* constParts, size_t count, size_t written) { + TTempBuf tempbuf(sizeof(TPart) * count); + TPart* parts = (TPart*)tempbuf.Data(); + + for (size_t i = 0; i < count; ++i) { + parts[i] = constParts[i]; + } + + TContIOVector vec(parts, count); + vec.Proceed(written); + + while (!vec.Complete()) { + ssize_t ret = SendVImpl(fd, vec.Parts(), vec.Count()); + if (ret < 0) { - return ret; + return ret; } - - written += ret; - - vec.Proceed((size_t)ret); - } - - return written; -} - + + written += ret; + + vec.Proceed((size_t)ret); + } + + return written; +} + static inline TSocket::TOps* GetCommonSockOps() noexcept { return Singleton<TCommonSockOps>(); } diff --git a/util/string/vector.h b/util/string/vector.h index 4f31ce429f..e36c348bbe 100644 --- a/util/string/vector.h +++ b/util/string/vector.h @@ -64,8 +64,8 @@ TVector<typename ::NPrivate::TStringDeducer<C>::type> SplitString(const typename ::NPrivate::TStringDeducer<C>::type& str, const C* delimiter, size_t maxFields = 0, int options = 0) { return SplitString(str.data(), str.size(), delimiter, maxFields, options); -} - +} + template <class TIter> inline TString JoinStrings(TIter begin, TIter end, const TStringBuf delim) { if (begin == end) diff --git a/util/system/fs.cpp b/util/system/fs.cpp index 056fcbea35..d2611a8ccc 100644 --- a/util/system/fs.cpp +++ b/util/system/fs.cpp @@ -8,8 +8,8 @@ #include <errno.h> #endif -#include <util/generic/yexception.h> -#include <util/memory/tempbuf.h> +#include <util/generic/yexception.h> +#include <util/memory/tempbuf.h> #include <util/stream/file.h> #include <util/charset/wide.h> #include <util/folder/iterator.h> |