|
From: <eli...@us...> - 2006-05-29 12:30:50
|
Revision: 2343 Author: elias_naur Date: 2006-05-29 05:30:23 -0700 (Mon, 29 May 2006) ViewCVS: http://svn.sourceforge.net/java-game-lib/?rev=2343&view=rev Log Message: ----------- Split out the exception case in BufferChecks.checkBufferSize() to help the JVM inline it Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/BufferChecks.java Modified: trunk/LWJGL/src/java/org/lwjgl/BufferChecks.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/BufferChecks.java 2006-05-29 12:24:46 UTC (rev 2342) +++ trunk/LWJGL/src/java/org/lwjgl/BufferChecks.java 2006-05-29 12:30:23 UTC (rev 2343) @@ -178,6 +178,13 @@ } /** + * This is a separate call to help inline checkBufferSize. + */ + private static void throwBufferSizeException(Buffer buf, int size) { + throw new IllegalArgumentException("Number of remaining buffer elements is " + buf.remaining() + ", must be at least " + size); + } + + /** * Helper method to ensure a buffer is big enough to receive data from a * glGet* operation. * @@ -189,7 +196,7 @@ */ private static void checkBufferSize(Buffer buf, int size) { if (buf.remaining() < size) { - throw new IllegalArgumentException("Number of remaining buffer elements is " + buf.remaining() + ", must be at least " + size); + throwBufferSizeException(buf, size); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |