mirror of https://codeberg.org/topola/topola.git
autorouter: if unable to route to compare detours, assume equal
This commit is contained in:
parent
31bc9a9447
commit
72e630543d
|
|
@ -1,3 +1,5 @@
|
|||
use std::cmp::Ordering;
|
||||
|
||||
use contracts::debug_requires;
|
||||
use enum_dispatch::enum_dispatch;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
|
@ -257,8 +259,11 @@ impl<M: AccessMesadata> Invoker<M> {
|
|||
ratlines.sort_unstable_by(|a, b| {
|
||||
let mut compare_detours =
|
||||
self.autorouter.compare_detours_ratlines(*a, *b).unwrap();
|
||||
let (al, bl) = compare_detours.finish(&mut self.autorouter).unwrap();
|
||||
if let Ok((al, bl)) = compare_detours.finish(&mut self.autorouter) {
|
||||
PartialOrd::partial_cmp(&al, &bl).unwrap()
|
||||
} else {
|
||||
Ordering::Equal
|
||||
}
|
||||
});
|
||||
Ok::<Execute, InvokerError>(Execute::Autoroute(
|
||||
self.autorouter.autoroute_ratlines(ratlines)?,
|
||||
|
|
|
|||
Loading…
Reference in New Issue