mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-11 08:30:55 +00:00
Marginally optimised set_offset
to avoid reset
s when possible.
This commit is contained in:
parent
06ea81fdb2
commit
a026998682
@ -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();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user