Skip to content

Commit d815b7c

Browse files
author
xiao.dong
committed
fix format
1 parent 2dfa617 commit d815b7c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/iceberg/table_metadata.cc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
#include <zlib.h>
2323

24+
#include <array>
2425
#include <format>
2526
#include <string>
2627

@@ -160,13 +161,13 @@ Result<std::string> DecompressGZIPFile(const std::string& filepath) {
160161
return IOError("Failed to open gzip file:{} ", filepath);
161162
}
162163

163-
const int CHUNK_SIZE = 32768; // 32KB chunks
164-
char buffer[CHUNK_SIZE];
164+
static const int CHUNK_SIZE = 32768; // 32KB chunks
165+
std::array<char, CHUNK_SIZE> buffer;
165166
std::string result;
166167
int bytes_read;
167168

168-
while ((bytes_read = gzread(file, buffer, CHUNK_SIZE)) > 0) {
169-
result.append(buffer, bytes_read);
169+
while ((bytes_read = gzread(file, buffer.data(), CHUNK_SIZE)) > 0) {
170+
result.append(buffer.data(), bytes_read);
170171
}
171172

172173
int err;

0 commit comments

Comments
 (0)