From 01402b4272348e5f1fa857efba535396b90ea24d Mon Sep 17 00:00:00 2001 From: Maxim Pimenov Date: Fri, 20 Sep 2019 15:51:15 +0300 Subject: [PATCH] [coding] Better padding in FilesContainerWriter. --- coding/file_writer.hpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/coding/file_writer.hpp b/coding/file_writer.hpp index fac33762cd..f83911e622 100644 --- a/coding/file_writer.hpp +++ b/coding/file_writer.hpp @@ -2,15 +2,15 @@ #include "coding/writer.hpp" #include "coding/internal/file_data.hpp" +#include "coding/write_to_sink.hpp" #include "base/assert.hpp" -#include "base/base.hpp" +#include "base/macros.hpp" #include #include #include #include -#include // FileWriter, not thread safe. class FileWriter : public Writer @@ -78,8 +78,7 @@ private: uint64_t const padding = ((offset + factor - 1) / factor) * factor - offset; if (padding == 0) return; - std::vector buffer(static_cast(padding)); - Write(buffer.data(), buffer.size()); + WriteZeroesToSink(*this, padding); } };