Merge pull request #3309 from miiichael/patch-1
Resize stateByID by 10% instead of a single element at a time
This commit is contained in:
commit
aef7a16b1c
1 changed files with 2 additions and 1 deletions
|
|
@ -239,7 +239,8 @@ public class DynmapPlugin
|
|||
int idx = bsids.getId(bs);
|
||||
if (idx >= stateByID.length) {
|
||||
int plen = stateByID.length;
|
||||
stateByID = Arrays.copyOf(stateByID, idx+1);
|
||||
stateByID = Arrays.copyOf(stateByID, idx*11/10); // grow array by 10%
|
||||
Log.debug("Resized stateByID from " + plen + " to " + stateByID.length);
|
||||
Arrays.fill(stateByID, plen, stateByID.length, DynmapBlockState.AIR);
|
||||
}
|
||||
Block b = bs.getBlock();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue