1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-01-11 08:30:55 +00:00

Marginally optimised set_offset to avoid resets when possible.

This commit is contained in:
Thomas Harte 2017-07-21 20:43:20 -04:00
parent 06ea81fdb2
commit a026998682

View File

@ -55,7 +55,11 @@ uint64_t Tape::get_offset() {
}
void Tape::set_offset(uint64_t offset) {
reset();
if(offset == offset_) return;
if(offset < offset_) {
reset();
}
offset -= offset_;
while(offset--) get_next_pulse();
}