Using trove collections for most internal stuff, using array access in BlockType and ItemType

This commit is contained in:
zml2008
2012-01-16 18:46:33 -08:00
parent 31bd786fdf
commit 410ac65c6a
7 changed files with 88 additions and 48 deletions

View File

@ -39,6 +39,8 @@ import com.sk89q.worldedit.expression.ExpressionException;
import com.sk89q.worldedit.expression.runtime.RValue;
import com.sk89q.worldedit.masks.Mask;
import com.sk89q.worldedit.patterns.*;
import gnu.trove.set.TIntSet;
import gnu.trove.set.hash.TIntHashSet;
/**
* This class can wrap all block editing operations into one "edit session" that
@ -118,7 +120,7 @@ public class EditSession {
/**
* List of missing blocks;
*/
private Set<Integer> missingBlocks = new HashSet<Integer>();
private TIntSet missingBlocks = new TIntHashSet();
/**
* Mask to cover operations.
@ -660,9 +662,9 @@ public class EditSession {
*
* @return
*/
public Set<Integer> popMissingBlocks() {
Set<Integer> missingBlocks = this.missingBlocks;
this.missingBlocks = new HashSet<Integer>();
public TIntSet popMissingBlocks() {
TIntSet missingBlocks = this.missingBlocks;
this.missingBlocks = new TIntHashSet();
return missingBlocks;
}