From b2b1ec04af8512be0d3fc3ce73713d812e550f71 Mon Sep 17 00:00:00 2001
From: Amanda Ghassaei <amandaghassaei@gmail.com>
Date: Mon, 23 Feb 2015 14:43:00 -0500
Subject: [PATCH] remove cells directly, no need to do index lookup

---
 js/threeViews/Highlighter.js | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/js/threeViews/Highlighter.js b/js/threeViews/Highlighter.js
index 1a890e67..34e68cb4 100644
--- a/js/threeViews/Highlighter.js
+++ b/js/threeViews/Highlighter.js
@@ -80,7 +80,11 @@ Highlighter = Backbone.View.extend({
             window.lattice.addCellAtIndex(this._getNextCellPosition(this.highlightedObject.getIndex(this.mesh)));
         } else {
             if (!this.highlightedObject || !this.highlightedObject.canRemove()) return;
-            window.lattice.removeCellAtIndex(this.highlightedObject.getIndex(this.mesh));
+            if (this.highlightedObject instanceof DMACell){
+                window.lattice.removeCell(this.highlightedObject);
+                return;
+            }
+//            window.lattice.removeCellAtIndex(this.highlightedObject.getIndex(this.mesh));
         }
         this.hide();
         this.highlightedObject = null;
-- 
GitLab