We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 29c199c commit e627451Copy full SHA for e627451
1 file changed
src/circuit.rs
@@ -155,6 +155,12 @@ impl Circuit {
155
}
156
157
fn insert_wire(&mut self, start: IVec2, end: IVec2) -> bool {
158
+ // Lexicographically order the start/end points to ensure "backwards" duplicates
159
+ // get caught.
160
+ if <[i32; 2]>::from(start) > <[i32; 2]>::from(end) {
161
+ return self.insert_wire(end, start);
162
+ }
163
+
164
// Either a wire's start and end X coordinates need to be the same,
165
// or their Y coordinates need to be the same, but not both.
166
// (If both, then the wire would be zero-length, which is not useful.)
@@ -221,7 +227,6 @@ impl Circuit {
221
227
if *slot == Some(wire_id) {
222
228
removed = true;
223
229
*slot = None;
224
- break;
225
230
226
231
232
assert!(removed);
0 commit comments