diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-05 12:36:37 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-05 12:36:37 +0200 |
commit | 7ca4aa7b91179c635195ec0e3d749ced31e206be (patch) | |
tree | d951121a625075ce652d7f628806452a1543512c /core | |
parent | 291df4182714ac56dffa4d12bb91a83fe7be29ae (diff) | |
download | RustAndDust-7ca4aa7b91179c635195ec0e3d749ced31e206be.zip RustAndDust-7ca4aa7b91179c635195ec0e3d749ced31e206be.tar.gz |
Board.nodesToSet is good enough
Diffstat (limited to 'core')
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/Board.java | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Board.java b/core/src/ch/asynk/tankontank/engine/Board.java index 6a5867e..9a0ac32 100644 --- a/core/src/ch/asynk/tankontank/engine/Board.java +++ b/core/src/ch/asynk/tankontank/engine/Board.java @@ -303,16 +303,13 @@ public abstract class Board implements Disposable private int nodesToSet(List<Vector<SearchBoard.Node>> nodes, Set<GridPoint2> points) { - // FIXME : optimize this for (GridPoint2 point : points) gridPoint2Pool.free(point); points.clear(); for (Vector<SearchBoard.Node> path : nodes) { - for (int i = 0, n = path.size(); i < n; i++) { - // FIXME : optimize this + for (SearchBoard.Node node : path) { GridPoint2 point = gridPoint2Pool.obtain(); - SearchBoard.Node node = path.get(i); point.set(node.col, node.row); if (!points.add(point)) gridPoint2Pool.free(point); |