Skip to content

Commit

Permalink
rename variables snake case
Browse files Browse the repository at this point in the history
  • Loading branch information
omer-candan committed Aug 21, 2024
1 parent 5b325e2 commit 3217355
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions ortools/base/gzipfile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ absl::Status WriteToGzipFile(const absl::string_view filename,
// have to write in chunks, otherwise fails to compress big files.
constexpr size_t chunk = 1024 * 1024; // 1 MB chunk size.
size_t remaining = contents.size();
const char* dataPtr = contents.data();
const char* chunk_start_point = contents.data();

while (remaining > 0) {
size_t current_chunk = std::min(chunk, remaining);
size_t written = gzwrite(gz_file, dataPtr, current_chunk);
size_t written = gzwrite(gz_file, chunk_start_point, current_chunk);
if (written != current_chunk) {
int errNo = 0;
absl::string_view error_message = gzerror(gz_file, &errNo);
int err_no = 0;
absl::string_view error_message = gzerror(gz_file, &err_no);
gzclose(gz_file);
return {
absl::StatusCode::kInternal,
Expand All @@ -58,13 +58,13 @@ absl::Status WriteToGzipFile(const absl::string_view filename,
};
}

dataPtr += current_chunk;
chunk_start_point += current_chunk;
remaining -= current_chunk;
}

if (const int status = gzclose(gz_file); status != Z_OK) {
int errNo;
absl::string_view error_message = gzerror(gz_file, &errNo);
int err_no;
absl::string_view error_message = gzerror(gz_file, &err_no);
return {
absl::StatusCode::kInternal,
absl::StrCat(
Expand Down

0 comments on commit 3217355

Please sign in to comment.