mirror of
https://github.com/TomHarte/CLK.git
synced 2025-08-05 08:26:28 +00:00
Marginally optimised set_offset
to avoid reset
s when possible.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user