Skip to content

Commit 8f04a2e

Browse files
authored
Merge pull request #19 from JavaBWAPI/unsafe
Use Unsafe to avoid bounds checking
2 parents bca7c12 + 318c36d commit 8f04a2e

File tree

5 files changed

+694
-589
lines changed

5 files changed

+694
-589
lines changed

src/main/java/bwapi/Buffers.java

Lines changed: 0 additions & 40 deletions
This file was deleted.

src/main/java/bwapi/Client.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ class Client {
6262
try {
6363
this.connect(procID);
6464
return;
65-
} catch (final Exception exception) {
66-
System.err.println(exception);
65+
} catch (final Exception e) {
66+
System.err.println(e.getMessage());
6767
}
6868
}
6969
}
@@ -85,7 +85,6 @@ private void connect(final int procID) throws Exception {
8585
final ByteBuffer sharedMemory = Kernel32.INSTANCE.MapViewOfFile(MappingKernel.INSTANCE
8686
.OpenFileMapping(READ_WRITE, false, "Local\\bwapi_shared_memory_" + procID), READ_WRITE,
8787
0, 0, GameData.SIZE).getByteBuffer(0, GameData.SIZE);
88-
sharedMemory.order(ByteOrder.LITTLE_ENDIAN);
8988
data = new ClientData(sharedMemory).new GameData(0);
9089

9190
final int clientVersion = data.getClient_version();

0 commit comments

Comments
 (0)