From b96d42d4104bec9f562f0bf43546a851a772fbca Mon Sep 17 00:00:00 2001
From: Jake <jake.read@cba.mit.edu>
Date: Wed, 17 Jul 2019 21:31:43 -0400
Subject: [PATCH] cleanup old mess

---
 view/vtoplevel.js | 57 -----------------------------------------------
 1 file changed, 57 deletions(-)

diff --git a/view/vtoplevel.js b/view/vtoplevel.js
index f021a02..a9e07c1 100644
--- a/view/vtoplevel.js
+++ b/view/vtoplevel.js
@@ -620,60 +620,3 @@ function makeTopLevel(view) {
 }
 
 export default makeTopLevel
-
-let oldshit = () => {
-  if (debug) console.log("BUILD: diving")
-  let lcounter = 0
-  let twocounter = 0
-  // well, ya didn't know it, but you're here to write a graph traversal scheme
-  // one must start somewhere,
-  // let's find the links of the output's parent
-  for (let df of opv.defs) {
-    if (df.type === 'link') {
-      if (debug) console.log(`BUILD: find link ${df.name}`)
-      let dfr = df.reciprocalLink
-      if (dfr) {
-        if (debug) console.log(`BUILD: find reciprocal link ${dfr.name} for ${df.name}`)
-        // that's one traverse, let's check
-        if (dfr.parentView === ipv) {
-          // this is the 'other side'
-          // let's add that side first ... bottom - up
-          // this is the link's state item describing it's outputs, as it stands:
-          let opList = dfr.states[3].value
-          opList += `, auto_${lcounter}_${dfr.outputs.length} (${output.type})`
-          if (debug) console.log("BUILD: to req state for", opList)
-          // have to req via this view,
-          dfr.parentView.requestStateChange(dfr.states[3], opList).then(() => {
-            // tricky, tricky, and dangerous:
-            // we requested a state change on the dfr object,
-            // that swapped in a new definition (bc this state change req's an addition to outputs)
-            // so,
-            dfr = dfr.parentView.defs[dfr.ind]
-            return dfr.parentView.requestAddLink(dfr.outputs[dfr.outputs.length - 1], input)
-          }).then(() => {
-            let ipList = df.states[2].value
-            ipList += `, auto_${lcounter}_${dfr.outputs.length} (${output.type})`
-            return df.parentView.requestStateChange(df.states[2], ipList)
-          }).then(() => {
-            // swap happened,
-            df = df.parentView.defs[df.ind]
-            return df.parentView.requestAddLink(output, df.inputs[df.inputs.length - 1])
-          }).then(() => {
-            // note: !: since we repalced a few link definitions,
-            // we need to hook back their .reciprocalLinks,
-            // we can do that by calling:
-            view.globalOrganize()
-            // and finally,
-            resolve()
-          })
-        } else {
-          console.error('no second layer recursion yet, pls write, thx')
-          // would do same search over defs, for links, at this layer ...
-        }
-      } else {
-        console.log(`BUILD: no reciprocal link for ${df.name}`)
-      }
-    }
-  }
-
-}
-- 
GitLab