Browse Source

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

aperkov 3 years ago
parent
commit
2c97fff2ee
2 changed files with 38 additions and 38 deletions
  1. 27 27
      library/cpp/streams/lzma/lzma.cpp
  2. 11 11
      library/cpp/streams/lzma/lzma_ut.cpp

+ 27 - 27
library/cpp/streams/lzma/lzma.cpp

@@ -386,23 +386,23 @@ public:
 
 private:
     virtual bool Fill() = 0;
- 
+
 protected:
     CLzmaDec H_;
     char* InBegin_;
     char* InEnd_;
-}; 
- 
-class TLzmaDecompress::TImplStream: public TImpl { 
+};
+
+class TLzmaDecompress::TImplStream: public TImpl {
 public:
     inline TImplStream(IInputStream* slave)
         : Slave_(slave)
     {
         Byte buf[LZMA_PROPS_SIZE];
- 
+
         if (Slave_->Load(buf, sizeof(buf)) != sizeof(buf))
             ythrow yexception() << "can't read lzma header";
- 
+
         Check(LzmaDec_Allocate(&H_, buf, sizeof(buf), Alloc()));
         LzmaDec_Init(&H_);
     }
@@ -412,23 +412,23 @@ private:
         size_t size = Slave_->Read(In_, sizeof(In_));
         InBegin_ = In_;
         InEnd_ = In_ + size;
- 
+
         return size;
     }
- 
+
 private:
     IInputStream* Slave_;
     char In_[4096];
 };
 
-class TLzmaDecompress::TImplZeroCopy: public TLzmaDecompress::TImpl { 
-public: 
+class TLzmaDecompress::TImplZeroCopy: public TLzmaDecompress::TImpl {
+public:
     inline TImplZeroCopy(IZeroCopyInput* in)
-        : Input_(in) 
+        : Input_(in)
     {
         if (!Fill())
             ythrow yexception() << "can't read lzma header";
- 
+
         char buf[LZMA_PROPS_SIZE];
         char* header;
         if (InEnd_ - InBegin_ >= LZMA_PROPS_SIZE) {
@@ -451,18 +451,18 @@ public:
                     pos += avail;
                     if (!Fill()) {
                         ythrow yexception() << "can't read lzma header";
-                    } 
-                } 
-            } 
+                    }
+                }
+            }
             header = buf;
         }
- 
+
         Check(LzmaDec_Allocate(&H_, (Byte*)header, LZMA_PROPS_SIZE, Alloc()));
- 
+
         LzmaDec_Init(&H_);
     }
- 
-private: 
+
+private:
     bool Fill() override {
         size_t size = Input_->Next(&InBegin_);
 
@@ -474,10 +474,10 @@ private:
 
         return false;
     }
- 
+
     IZeroCopyInput* Input_;
-}; 
- 
+};
+
 TLzmaCompress::TLzmaCompress(IOutputStream* slave, size_t level)
     : Impl_(new TImpl(slave, level))
 {
@@ -503,15 +503,15 @@ void TLzmaCompress::DoFinish() {
 }
 
 TLzmaDecompress::TLzmaDecompress(IInputStream* slave)
-    : Impl_(new TImplStream(slave)) 
+    : Impl_(new TImplStream(slave))
 {
 }
 
 TLzmaDecompress::TLzmaDecompress(IZeroCopyInput* input)
-    : Impl_(new TImplZeroCopy(input)) 
-{ 
-} 
- 
+    : Impl_(new TImplZeroCopy(input))
+{
+}
+
 TLzmaDecompress::~TLzmaDecompress() {
 }
 

+ 11 - 11
library/cpp/streams/lzma/lzma_ut.cpp

@@ -13,7 +13,7 @@ public:
         , Pos(s.data())
     {
     }
- 
+
 private:
     size_t DoNext(const void** ptr, size_t len) override {
         if (Pos < Data.end()) {
@@ -23,13 +23,13 @@ private:
             return len;
         } else {
             return 0;
-        } 
+        }
     }
- 
+
     TString Data;
     const char* Pos;
-}; 
- 
+};
+
 class TLzmaTest: public TTestBase {
     UNIT_TEST_SUITE(TLzmaTest);
     UNIT_TEST(Test1)
@@ -99,27 +99,27 @@ private:
         }
 
         UNIT_ASSERT_EQUAL(data, data1);
- 
+
         data1.clear();
         {
             TMemoryInput mi(res.data(), res.size());
             TStringOutput so(data1);
             TLzmaDecompress d(&mi);
- 
+
             TransferData(&d, &so);
         }
- 
+
         UNIT_ASSERT_EQUAL(data, data1);
- 
+
         data1.clear();
         {
             TStrokaByOneByte mi(res);
             TStringOutput so(data1);
             TLzmaDecompress d(&mi);
- 
+
             TransferData(&d, &so);
         }
- 
+
         UNIT_ASSERT_EQUAL(data, data1);
     }
 };