diff options
| author | Julian Blake Kongslie | 2022-05-13 18:47:11 -0700 |
|---|---|---|
| committer | Julian Blake Kongslie | 2022-06-09 08:54:20 -0700 |
| commit | 34335a3eb5e92d692363cf1cbc170568f319bca0 (patch) | |
| tree | a3bb0b2f66b9ffe1357b1443e2a56f2fa362e0aa /lace.rb | |
| parent | Automatically define a method for ICs. (diff) | |
| download | lace-main.tar.xz | |
Diffstat (limited to '')
| -rw-r--r-- | lace.rb | 24 |
1 files changed, 12 insertions, 12 deletions
| @@ -103,21 +103,21 @@ module Lace | |||
| 103 | end | 103 | end |
| 104 | 104 | ||
| 105 | def merge_nets(a, b) | 105 | def merge_nets(a, b) |
| 106 | da = definitive_net(a) | 106 | a = definitive_net(a) |
| 107 | db = definitive_net(b) | 107 | b = definitive_net(b) |
| 108 | return da if da.object_id == db.object_id | 108 | return a if a.object_id == b.object_id |
| 109 | into = @nets[[da.object_id, db.object_id].min] | 109 | into = @nets[[a.object_id, b.object_id].min] |
| 110 | if da.name | 110 | if a.name |
| 111 | raise "Nets #{into.name} and #{da.name} merged!" if into.name and into.name != da.name | 111 | raise "Nets #{into.name} and #{a.name} merged!" if into.name and into.name != a.name |
| 112 | into.name = da.name | 112 | into.name = a.name |
| 113 | end | 113 | end |
| 114 | if db.name | 114 | if b.name |
| 115 | raise "Nets #{into.name} and #{db.name} merged!" if into.name and into.name != db.name | 115 | raise "Nets #{into.name} and #{b.name} merged!" if into.name and into.name != b.name |
| 116 | into.name = db.name | 116 | into.name = b.name |
| 117 | end | 117 | end |
| 118 | @nets.each do | id, n | | 118 | @nets.each do | id, n | |
| 119 | dn = definitive_net(n) | 119 | n = definitive_net(n) |
| 120 | if dn.object_id != into.object_id and (dn.object_id == da.object_id or dn.object_id == db.object_id) | 120 | if n.object_id != into.object_id and (n.object_id == a.object_id or n.object_id == b.object_id) |
| 121 | @nets[id] = into | 121 | @nets[id] = into |
| 122 | end | 122 | end |
| 123 | end | 123 | end |
