1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-06-09 17:29:36 +00:00

Name repeated constant.

(... and, I think, four is enough)
This commit is contained in:
Thomas Harte 2023-12-27 10:00:01 -05:00
parent 7b343b25cc
commit f83c3e7af0

View File

@ -55,6 +55,8 @@ long NIB::file_offset(Track::Address address) {
}
std::shared_ptr<::Storage::Disk::Track> NIB::get_track_at_position(::Storage::Disk::Track::Address address) {
static constexpr size_t MinimumSyncByteCount = 4;
// NIBs contain data for a fixed quantity of integer-position tracks underneath a single head only.
//
// Therefore:
@ -91,8 +93,8 @@ std::shared_ptr<::Storage::Disk::Track> NIB::get_track_at_position(::Storage::Di
}
// If that's at least five, regress and mark all as syncs.
if(length >= 5) {
for(int c = 0; c < 5; c++) {
if(length >= MinimumSyncByteCount) {
for(int c = 0; c < int(MinimumSyncByteCount); c++) {
end = (end + track_data.size() - 1) % track_data.size();
sync_locations.insert(end);
}