Pedantic perf thing, flatten raw int[] list instead of List<Integer> for slightly...
authorMark Slee <mcslee@Mark-Slees-MacBook-Pro.local>
Wed, 12 Jun 2013 02:39:48 +0000 (19:39 -0700)
committerMark Slee <mcslee@Mark-Slees-MacBook-Pro.local>
Wed, 12 Jun 2013 02:39:48 +0000 (19:39 -0700)
_PandaDriver.pde

index 28701e9bde957e395a70364d46f42a0aa29b3925..6a4a3da021c760c15873fda6583fc155fa16b9b8 100644 (file)
@@ -23,7 +23,7 @@ public class PandaDriver {
   private final OscMessage message;
 
   // List of point indices on the board
-  private final List<Integer> points;
+  private final int[] points;
 
   // Bit for flipped status of each point index
   private final boolean[] flipped;
@@ -34,7 +34,12 @@ public class PandaDriver {
   public PandaDriver(NetAddress address, Model model, int[][] channelList, int[][] flippedList) {
     this.address = address;
     message = new OscMessage("/shady/pointbuffer");
-    points = buildMappedList(model, channelList);
+    List<Integer> pointList = buildMappedList(model, channelList);
+    points = new int[pointList.size()];
+    int i = 0;
+    for (int value : pointList) {
+      points[i++] = value;
+    }
     flipped = buildFlippedList(model, flippedList);
   }