Skip to content

Commit

Permalink
[autofix.ci] apply automated fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
autofix-ci[bot] authored Mar 24, 2024
1 parent 526db66 commit 655ecf9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 17 deletions.
14 changes: 4 additions & 10 deletions src/chunkedstorage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,8 @@ void Writer::saveCurrentChunk()
bufferCompressed.resize( maxCompressedSize );


const size_t size_or_err = ZSTD_compress2( zstd_cctx.get(),
bufferCompressed.data(),
bufferCompressed.size(),
buffer.data(),
bufferUsed );
const size_t size_or_err =
ZSTD_compress2( zstd_cctx.get(), bufferCompressed.data(), bufferCompressed.size(), buffer.data(), bufferUsed );
if ( ZSTD_isError( size_or_err ) ) {
throw exFailedToCompressChunk();
}
Expand Down Expand Up @@ -172,11 +169,8 @@ char * Reader::getBlock( uint32_t address, vector< char > & chunk )

unsigned long decompressedLength = chunk.size();

size_t const size_or_err = ZSTD_decompressDCtx( zstd_dctx.get(),
chunk.data(),
decompressedLength,
chunkDataBytes,
compressedSize );
size_t const size_or_err =
ZSTD_decompressDCtx( zstd_dctx.get(), chunk.data(), decompressedLength, chunkDataBytes, compressedSize );

if ( ZSTD_isError( size_or_err ) || size_or_err != chunk.size() ) {
throw exFailedToDecompressChunk();
Expand Down
4 changes: 2 additions & 2 deletions src/chunkedstorage.hh
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ private:

void saveCurrentChunk();

std::unique_ptr<ZSTD_CCtx,zstd_deleter> zstd_cctx;
std::unique_ptr< ZSTD_CCtx, zstd_deleter > zstd_cctx;
};

/// This class reads data blocks previously written by Writer.
Expand All @@ -100,7 +100,7 @@ public:
char * getBlock( uint32_t address, vector< char > & );

private:
std::unique_ptr<ZSTD_DCtx,zstd_deleter> zstd_dctx;
std::unique_ptr< ZSTD_DCtx, zstd_deleter > zstd_dctx;
};

} // namespace ChunkedStorage
Expand Down
10 changes: 5 additions & 5 deletions src/dict/mdx.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1270,12 +1270,12 @@ vector< sptr< Dictionary::Class > > makeDictionaries( vector< string > const & f

string dictId = Dictionary::makeDictionaryId( dictFiles );
string indexFile = indicesDir + dictId;
int t = 20;
mdxbench:
int t = 20;
mdxbench:
if ( true ) {
// Building the index

// gdDebug( "MDict: Building the index for dictionary: %s\n", fileName.c_str() );
// gdDebug( "MDict: Building the index for dictionary: %s\n", fileName.c_str() );
auto index_begin = std::chrono::high_resolution_clock::now();

MdictParser parser;
Expand Down Expand Up @@ -1435,8 +1435,8 @@ vector< sptr< Dictionary::Class > > makeDictionaries( vector< string > const & f
idx.rewind();
idx.write( &idxHeader, sizeof( idxHeader ) );

auto index_finish = std::chrono::high_resolution_clock::now();
std::chrono::duration<double, std::milli> c = index_finish - index_begin;
auto index_finish = std::chrono::high_resolution_clock::now();
std::chrono::duration< double, std::milli > c = index_finish - index_begin;
qDebug() << c;

t = t - 1;
Expand Down

0 comments on commit 655ecf9

Please sign in to comment.