Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
uweseimet committed Jan 13, 2025
1 parent 862125a commit 8c73616
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions cpp/devices/disk_track.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,16 @@ bool DiskTrack::Save(const string &path, uint64_t &cache_miss_write_count)
}

// Write consecutive sectors
for (int i = 0; i < sector_count;) {
int i = 0;
while (i < sector_count) {
if (modified_flags[i]) {
int total = 0;

// Determine consecutive sector range
int j;
for (j = i; j < sector_count; ++j) {
if (!modified_flags[j]) {
break;
}

int j = i;
while (j < sector_count && modified_flags[j]) {
total += size;
++j;
}

out.seekp(offset + (i << shift_count));
Expand Down

0 comments on commit 8c73616

Please sign in to comment.