Browse Source

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

olegator 3 years ago
parent
commit
553b4d1ea5

+ 1 - 1
library/cpp/string_utils/quote/quote_ut.cpp

@@ -26,7 +26,7 @@ Y_UNIT_TEST_SUITE(TCGIEscapeTest) {
     }
 
     Y_UNIT_TEST(StrokaRet) {
-        UNIT_ASSERT_VALUES_EQUAL(CGIEscapeRet("!@#$%^&*(){}[]\" "), TString("!@%23$%25^%26*%28%29%7B%7D%5B%5D%22+")); 
+        UNIT_ASSERT_VALUES_EQUAL(CGIEscapeRet("!@#$%^&*(){}[]\" "), TString("!@%23$%25^%26*%28%29%7B%7D%5B%5D%22+"));
     }
 
     Y_UNIT_TEST(StrokaAppendRet) {

+ 6 - 6
library/cpp/string_utils/url/url.cpp

@@ -182,18 +182,18 @@ TStringBuf GetSchemeHostAndPort(const TStringBuf url, bool trimHttp, bool trimDe
     }
 }
 
-void SplitUrlToHostAndPath(const TStringBuf url, TStringBuf& host, TStringBuf& path) { 
+void SplitUrlToHostAndPath(const TStringBuf url, TStringBuf& host, TStringBuf& path) {
     auto [hostBuf, pathBuf] = NUrl::SplitUrlToHostAndPath(url);
     host = hostBuf;
     path = pathBuf;
-} 
- 
-void SplitUrlToHostAndPath(const TStringBuf url, TString& host, TString& path) { 
+}
+
+void SplitUrlToHostAndPath(const TStringBuf url, TString& host, TString& path) {
     auto [hostBuf, pathBuf] = NUrl::SplitUrlToHostAndPath(url);
     host = hostBuf;
     path = pathBuf;
-} 
- 
+}
+
 void SeparateUrlFromQueryAndFragment(const TStringBuf url, TStringBuf& sanitizedUrl, TStringBuf& query, TStringBuf& fragment) {
     TStringBuf urlWithoutFragment;
     if (!url.TrySplit('#', urlWithoutFragment, fragment)) {

+ 10 - 10
library/cpp/string_utils/url/url.h

@@ -73,16 +73,16 @@ Y_PURE_FUNCTION
 TStringBuf GetSchemeHostAndPort(const TStringBuf url, bool trimHttp = true, bool trimDefaultPort = true) noexcept;
 
 /**
- * Splits URL to host and path 
- * 
- * @param[in] url       any URL 
- * @param[out] host     parsed host 
- * @param[out] path     parsed path 
- */ 
-void SplitUrlToHostAndPath(const TStringBuf url, TStringBuf& host, TStringBuf& path); 
-void SplitUrlToHostAndPath(const TStringBuf url, TString& host, TString& path); 
- 
-/** 
+ * Splits URL to host and path
+ *
+ * @param[in] url       any URL
+ * @param[out] host     parsed host
+ * @param[out] path     parsed path
+ */
+void SplitUrlToHostAndPath(const TStringBuf url, TStringBuf& host, TStringBuf& path);
+void SplitUrlToHostAndPath(const TStringBuf url, TString& host, TString& path);
+
+/**
  * Separates URL into url prefix, query (aka cgi params list), and fragment (aka part after #)
  *
  * @param[in] url               any URL

+ 19 - 19
library/cpp/string_utils/url/url_ut.cpp

@@ -128,29 +128,29 @@ Y_UNIT_TEST_SUITE(TUtilUrlTest) {
     }
 
     Y_UNIT_TEST(TestSplitUrlToHostAndPath) {
-        TStringBuf host, path; 
- 
-        SplitUrlToHostAndPath("https://yandex.ru/yandsearch", host, path); 
-        UNIT_ASSERT_STRINGS_EQUAL(host, "https://yandex.ru"); 
-        UNIT_ASSERT_STRINGS_EQUAL(path, "/yandsearch"); 
- 
-        SplitUrlToHostAndPath("yandex.ru/yandsearch", host, path); 
-        UNIT_ASSERT_STRINGS_EQUAL(host, "yandex.ru"); 
-        UNIT_ASSERT_STRINGS_EQUAL(path, "/yandsearch"); 
- 
-        SplitUrlToHostAndPath("https://yandex.ru", host, path); 
-        UNIT_ASSERT_STRINGS_EQUAL(host, "https://yandex.ru"); 
-        UNIT_ASSERT_STRINGS_EQUAL(path, ""); 
- 
-        SplitUrlToHostAndPath("invalid url /", host, path); 
-        UNIT_ASSERT_STRINGS_EQUAL(host, "invalid url "); 
-        UNIT_ASSERT_STRINGS_EQUAL(path, "/"); 
+        TStringBuf host, path;
+
+        SplitUrlToHostAndPath("https://yandex.ru/yandsearch", host, path);
+        UNIT_ASSERT_STRINGS_EQUAL(host, "https://yandex.ru");
+        UNIT_ASSERT_STRINGS_EQUAL(path, "/yandsearch");
+
+        SplitUrlToHostAndPath("yandex.ru/yandsearch", host, path);
+        UNIT_ASSERT_STRINGS_EQUAL(host, "yandex.ru");
+        UNIT_ASSERT_STRINGS_EQUAL(path, "/yandsearch");
+
+        SplitUrlToHostAndPath("https://yandex.ru", host, path);
+        UNIT_ASSERT_STRINGS_EQUAL(host, "https://yandex.ru");
+        UNIT_ASSERT_STRINGS_EQUAL(path, "");
+
+        SplitUrlToHostAndPath("invalid url /", host, path);
+        UNIT_ASSERT_STRINGS_EQUAL(host, "invalid url ");
+        UNIT_ASSERT_STRINGS_EQUAL(path, "/");
 
         SplitUrlToHostAndPath("some_blender_url", host, path);
         UNIT_ASSERT_STRINGS_EQUAL(host, "some_blender_url");
         UNIT_ASSERT_STRINGS_EQUAL(path, "");
-    } 
- 
+    }
+
     Y_UNIT_TEST(TestSeparateUrlFromQueryAndFragment) {
         TStringBuf sanitizedUrl, query, fragment;
 

+ 1 - 1
util/digest/murmur.cpp

@@ -126,6 +126,6 @@ namespace NMurmurPrivate {
     }
 }
 
-size_t MurmurHashSizeT(const char* buf, size_t len) noexcept { 
+size_t MurmurHashSizeT(const char* buf, size_t len) noexcept {
     return MurmurHash<size_t>(buf, len);
 }

+ 4 - 4
util/digest/murmur.h

@@ -35,21 +35,21 @@ static inline T MurmurHash(const void* buf, size_t len, T init) noexcept {
 }
 
 template <class T>
-static inline T MurmurHash(const void* buf, size_t len) noexcept { 
+static inline T MurmurHash(const void* buf, size_t len) noexcept {
     return MurmurHash<T>(buf, len, (T)0);
 }
 
 //non-inline version
-size_t MurmurHashSizeT(const char* buf, size_t len) noexcept; 
+size_t MurmurHashSizeT(const char* buf, size_t len) noexcept;
 
 template <typename TOut = size_t>
 struct TMurmurHash {
-    TOut operator()(const void* buf, size_t len) const noexcept { 
+    TOut operator()(const void* buf, size_t len) const noexcept {
         return MurmurHash<TOut>(buf, len);
     }
 
     template <typename ElementType>
-    TOut operator()(const TArrayRef<ElementType>& data) const noexcept { 
+    TOut operator()(const TArrayRef<ElementType>& data) const noexcept {
         return operator()(data.data(), data.size() * sizeof(ElementType));
     }
 };

+ 1 - 1
util/generic/serialized_enum.h

@@ -16,7 +16,7 @@ It doesn't contains definitions. To generate them you have to add
 or
     GENERATE_ENUM_SERIALIZATION(your_header_with_your_enum.h)
 
-in your ya.make 
+in your ya.make
 
 @see https://st.yandex-team.ru/IGNIETFERRO-333
 @see https://wiki.yandex-team.ru/PoiskovajaPlatforma/Build/WritingCmakefiles/#generate-enum-with-header

+ 2 - 2
util/thread/pool.h

@@ -383,8 +383,8 @@ inline void Delete(THolder<IThreadPool> q) {
     }
 }
 
-/** 
+/**
  * Creates and starts TThreadPool if threadsCount > 1, or TFakeThreadPool otherwise
  * You could specify blocking and catching modes for TThreadPool only
- */ 
+ */
 THolder<IThreadPool> CreateThreadPool(size_t threadCount, size_t queueSizeLimit = 0, const IThreadPool::TParams& params = {});