aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorluchko <luchko@yandex-team.ru>2022-02-10 16:48:21 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:48:21 +0300
commit6400e9461eb46fbf792bb457abea992f9bb135c1 (patch)
tree5d5cb817648f650d76cf1076100726fd9b8448e8 /util
parent9f21dcc5d3d7c6e54e7adbaa2abaa6d86ae08c59 (diff)
downloadydb-6400e9461eb46fbf792bb457abea992f9bb135c1.tar.gz
Restoring authorship annotation for <luchko@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util')
-rw-r--r--util/charset/wide.cpp6
-rw-r--r--util/generic/bitmap.h66
-rw-r--r--util/stream/output.cpp16
-rw-r--r--util/stream/output.h6
4 files changed, 47 insertions, 47 deletions
diff --git a/util/charset/wide.cpp b/util/charset/wide.cpp
index e193cb495b..a287438ddd 100644
--- a/util/charset/wide.cpp
+++ b/util/charset/wide.cpp
@@ -602,9 +602,9 @@ void EscapeHtmlChars(TUtf16String& str) {
case '&':
ent = &amp;
break;
- case '\"':
- ent = &quot;
- break;
+ case '\"':
+ ent = &quot;
+ break;
default:
if (insertBr && (cs[i] == '\r' || cs[i] == '\n')) {
ent = &br;
diff --git a/util/generic/bitmap.h b/util/generic/bitmap.h
index 99096bc048..f77d182460 100644
--- a/util/generic/bitmap.h
+++ b/util/generic/bitmap.h
@@ -10,8 +10,8 @@
#include <util/system/yassert.h>
#include <util/system/defaults.h>
#include <util/str_stl.h>
-#include <util/ysaveload.h>
-
+#include <util/ysaveload.h>
+
namespace NBitMapPrivate {
// Returns number of bits set; result is in most significatnt byte
inline ui64 ByteSums(ui64 x) {
@@ -275,7 +275,7 @@ namespace NBitMapPrivate {
}
return true;
}
-
+
Y_FORCE_INLINE bool ExpandBitSize(size_t bitSize, bool keepData = true) {
return ExpandSize((bitSize + 8 * sizeof(TChunk) - 1) / (8 * sizeof(TChunk)), keepData);
}
@@ -509,7 +509,7 @@ public:
}
Y_FORCE_INLINE TReference operator[](size_t pos) {
- const bool fitStorage = Mask.ExpandBitSize(pos + 1);
+ const bool fitStorage = Mask.ExpandBitSize(pos + 1);
Y_ASSERT(fitStorage);
return TReference(&Mask.Data[pos >> DivCount], ModMask & pos);
}
@@ -519,7 +519,7 @@ public:
}
Y_FORCE_INLINE TThis& Set(size_t pos) {
- const bool fitStorage = Mask.ExpandBitSize(pos + 1);
+ const bool fitStorage = Mask.ExpandBitSize(pos + 1);
Y_ASSERT(fitStorage);
Mask.Data[pos >> DivCount] |= static_cast<TChunk>(1) << (pos & ModMask);
return *this;
@@ -552,7 +552,7 @@ public:
}
Y_FORCE_INLINE TThis& Flip(size_t pos) {
- const bool fitStorage = Mask.ExpandBitSize(pos + 1);
+ const bool fitStorage = Mask.ExpandBitSize(pos + 1);
Y_ASSERT(fitStorage);
Mask.Data[pos >> DivCount] ^= static_cast<TChunk>(1) << (pos & ModMask);
return *this;
@@ -617,8 +617,8 @@ public:
Y_FORCE_INLINE void Reserve(size_t bitCount) {
Y_VERIFY(Mask.ExpandBitSize(bitCount), "Exceeding bitmap storage capacity");
- }
-
+ }
+
Y_FORCE_INLINE size_t ValueBitCount() const {
size_t nonZeroChunk = Mask.GetChunkCapacity() - 1;
while (nonZeroChunk != 0 && !Mask.Data[nonZeroChunk])
@@ -722,7 +722,7 @@ public:
}
TThis& Xor(const TThis& bitmap) {
- Reserve(bitmap.Size());
+ Reserve(bitmap.Size());
for (size_t i = 0; i < bitmap.Mask.GetChunkCapacity(); ++i)
Mask.Data[i] ^= bitmap.Mask.Data[i];
return *this;
@@ -957,34 +957,34 @@ public:
count += ::NBitMapPrivate::CountBitsPrivate(Mask.Data[i]);
return count;
}
-
+
void Save(IOutputStream* out) const {
- ::Save(out, ui8(sizeof(TChunk)));
- ::Save(out, ui64(Size()));
- ::SavePodArray(out, Mask.Data, Mask.GetChunkCapacity());
- }
-
+ ::Save(out, ui8(sizeof(TChunk)));
+ ::Save(out, ui64(Size()));
+ ::SavePodArray(out, Mask.Data, Mask.GetChunkCapacity());
+ }
+
void Load(IInputStream* inp) {
- ui8 chunkSize = 0;
- ::Load(inp, chunkSize);
+ ui8 chunkSize = 0;
+ ::Load(inp, chunkSize);
Y_VERIFY(size_t(chunkSize) == sizeof(TChunk), "Chunk size is not the same");
-
- ui64 bitCount64 = 0;
- ::Load(inp, bitCount64);
- size_t bitCount = size_t(bitCount64);
- Reserve(bitCount);
-
- size_t chunkCount = 0;
- if (bitCount > 0) {
- chunkCount = ((bitCount - 1) >> DivCount) + 1;
- ::LoadPodArray(inp, Mask.Data, chunkCount);
- }
-
- if (chunkCount < Mask.GetChunkCapacity()) {
- ::memset(Mask.Data + chunkCount, 0, (Mask.GetChunkCapacity() - chunkCount) * sizeof(TChunk));
- }
+
+ ui64 bitCount64 = 0;
+ ::Load(inp, bitCount64);
+ size_t bitCount = size_t(bitCount64);
+ Reserve(bitCount);
+
+ size_t chunkCount = 0;
+ if (bitCount > 0) {
+ chunkCount = ((bitCount - 1) >> DivCount) + 1;
+ ::LoadPodArray(inp, Mask.Data, chunkCount);
+ }
+
+ if (chunkCount < Mask.GetChunkCapacity()) {
+ ::memset(Mask.Data + chunkCount, 0, (Mask.GetChunkCapacity() - chunkCount) * sizeof(TChunk));
+ }
Mask.Sanitize();
- }
+ }
inline size_t Hash() const {
THash<TChunk> chunkHasher;
diff --git a/util/stream/output.cpp b/util/stream/output.cpp
index 6598603d25..db81b81b70 100644
--- a/util/stream/output.cpp
+++ b/util/stream/output.cpp
@@ -210,7 +210,7 @@ void Out<typename std::vector<bool>::reference>(IOutputStream& o, const std::vec
#endif
#ifndef TSTRING_IS_STD_STRING
-template <>
+template <>
void Out<TBasicCharRef<TString>>(IOutputStream& o, const TBasicCharRef<TString>& c) {
o << static_cast<char>(c);
}
@@ -228,14 +228,14 @@ void Out<TBasicCharRef<TUtf32String>>(IOutputStream& o, const TBasicCharRef<TUtf
template <>
void Out<const void*>(IOutputStream& o, const void* t) {
- o << Hex(size_t(t));
-}
-
-template <>
+ o << Hex(size_t(t));
+}
+
+template <>
void Out<void*>(IOutputStream& o, void* t) {
- Out<const void*>(o, t);
-}
-
+ Out<const void*>(o, t);
+}
+
using TNullPtr = decltype(nullptr);
template <>
diff --git a/util/stream/output.h b/util/stream/output.h
index a1eeda2a20..00eef50b95 100644
--- a/util/stream/output.h
+++ b/util/stream/output.h
@@ -290,9 +290,9 @@ static inline void Endl(IOutputStream& o) {
* Flushing stream manipulator, basically the same as `std::flush`.
*/
static inline void Flush(IOutputStream& o) {
- o.Flush();
-}
-
+ o.Flush();
+}
+
/*
* Also see format.h for additional manipulators.
*/