mirror of
https://github.com/GTNewHorizons/ForgeRelocation.git
synced 2026-11-19 19:49:43 +00:00
make sure tu use the same size
This commit is contained in:
1 parent
5dd1fe1488
commit
45377a81c0
1 file changed
+6
-5
@@ -248,14 +248,15 @@ class WorldStructsMap {
|
||||
}
|
||||
|
||||
def foreach(f: (Int, WorldStructs) => Unit) {
|
||||
val ds = new Array[Int](size)
|
||||
val ss = new Array[WorldStructs](size)
|
||||
val n = synchronized { size }
|
||||
val ds = new Array[Int](n)
|
||||
val ss = new Array[WorldStructs](n)
|
||||
synchronized {
|
||||
System.arraycopy(dims, 0, ds, 0, size)
|
||||
System.arraycopy(structs, 0, ss, 0, size)
|
||||
System.arraycopy(dims, 0, ds, 0, n)
|
||||
System.arraycopy(structs, 0, ss, 0, n)
|
||||
}
|
||||
var i = 0
|
||||
while (i < ds.length) {
|
||||
while (i < n) {
|
||||
f(ds(i), ss(i))
|
||||
i += 1
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user