From e4d0d812bf21edff41d863460761866127bdefa2 Mon Sep 17 00:00:00 2001 From: Mark Slee Date: Tue, 11 Jun 2013 19:39:48 -0700 Subject: [PATCH] Pedantic perf thing, flatten raw int[] list instead of List for slightly faster iteration --- _PandaDriver.pde | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/_PandaDriver.pde b/_PandaDriver.pde index 28701e9..6a4a3da 100644 --- a/_PandaDriver.pde +++ b/_PandaDriver.pde @@ -23,7 +23,7 @@ public class PandaDriver { private final OscMessage message; // List of point indices on the board - private final List 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 pointList = buildMappedList(model, channelList); + points = new int[pointList.size()]; + int i = 0; + for (int value : pointList) { + points[i++] = value; + } flipped = buildFlippedList(model, flippedList); } -- 2.34.1