aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/codecs/sample.h
diff options
context:
space:
mode:
authorVlad Yaroslavlev <vladon@vladon.com>2022-02-10 16:46:25 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:25 +0300
commit344ea37b4a345701ab0e67de2266a1c1bd7baf2d (patch)
tree1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /library/cpp/codecs/sample.h
parent706b83ed7de5a473436620367af31fc0ceecde07 (diff)
downloadydb-344ea37b4a345701ab0e67de2266a1c1bd7baf2d.tar.gz
Restoring authorship annotation for Vlad Yaroslavlev <vladon@vladon.com>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/codecs/sample.h')
-rw-r--r--library/cpp/codecs/sample.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/library/cpp/codecs/sample.h b/library/cpp/codecs/sample.h
index 8aa62c7abd..15f03afcc5 100644
--- a/library/cpp/codecs/sample.h
+++ b/library/cpp/codecs/sample.h
@@ -30,11 +30,11 @@ namespace NCodecs {
template <class TItem>
class TSimpleSequenceReader: public ISequenceReader {
- const TVector<TItem>& Items;
+ const TVector<TItem>& Items;
size_t Idx = 0;
public:
- TSimpleSequenceReader(const TVector<TItem>& items)
+ TSimpleSequenceReader(const TVector<TItem>& items)
: Items(items)
{
}
@@ -64,13 +64,13 @@ namespace NCodecs {
}
template <class TIter, class TGetter>
- TVector<TBuffer> GetSample(TIter begin, TIter end, size_t sampleSizeBytes, TGetter getter) {
+ TVector<TBuffer> GetSample(TIter begin, TIter end, size_t sampleSizeBytes, TGetter getter) {
TFastRng64 rng{0x1ce1f2e507541a05, 0x07d45659, 0x7b8771030dd9917e, 0x2d6636ce};
size_t totalBytes = GetInputSize(begin, end, getter);
double sampleProb = (double)sampleSizeBytes / Max<size_t>(1, totalBytes);
- TVector<TBuffer> result;
+ TVector<TBuffer> result;
for (TIter iter = begin; iter != end; ++iter) {
if (sampleProb >= 1 || rng.GenRandReal1() < sampleProb) {
TStringBuf reg = getter(iter);
@@ -82,7 +82,7 @@ namespace NCodecs {
}
template <class TIter>
- TVector<TBuffer> GetSample(TIter begin, TIter end, size_t sampleSizeBytes) {
+ TVector<TBuffer> GetSample(TIter begin, TIter end, size_t sampleSizeBytes) {
return GetSample(begin, end, sampleSizeBytes, IterToStringBuf<TIter>);
}