mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2026-10-17 08:42:28 +00:00
progress
This commit is contained in:
1 parent
cc5f5653ef
commit
a486016d96
9 files changed
+405
-36
No files matched your search
@@ -0,0 +1,39 @@
|
||||
#[macro_export]
|
||||
macro_rules! for_each_window {
|
||||
(
|
||||
$left:expr,
|
||||
$right:expr,
|
||||
$window:expr,
|
||||
|$a:ident, $b:ident| $distance:expr,
|
||||
|$i:ident, $l:ident, $r:ident| $body:block,
|
||||
) => {{
|
||||
let mut start = $left;
|
||||
|
||||
for $i in $left..$right {
|
||||
while start + 1 < $i && {
|
||||
let $a = start;
|
||||
let $b = $i;
|
||||
$distance
|
||||
} > $window
|
||||
{
|
||||
start += 1;
|
||||
}
|
||||
|
||||
let mut end = $right.min($i + 2);
|
||||
|
||||
while end < $right && {
|
||||
let $a = $i;
|
||||
let $b = end;
|
||||
$distance
|
||||
} <= $window
|
||||
{
|
||||
end += 1;
|
||||
}
|
||||
|
||||
let $l = start;
|
||||
let $r = end - 1;
|
||||
|
||||
$body
|
||||
}
|
||||
}};
|
||||
}
|
||||
Reference in new issue
Block a user