Author: allain.lalonde Date: Wed Jul 15 10:59:40 2009 New Revision: 471 Modified: piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/util/PDebug.java
Log: Refactored PDebug code so that PMD didn't complain about two ifs that could be joined. In the process making it slightly clearer. Modified: piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/util/PDebug.java ============================================================================== --- piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/util/PDebug.java (original) +++ piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/util/PDebug.java Wed Jul 15 10:59:40 2009 @@ -101,19 +101,17 @@ processOutputTime += (System.currentTimeMillis() - startProcessingOutputTime); framesProcessed++; - if (PDebug.debugPrintFrameRate) { - if (framesProcessed % printResultsFrameRate == 0) { + if (framesProcessed % printResultsFrameRate == 0) { + if (PDebug.debugPrintFrameRate ) { System.out.println("Process output frame rate: " + getOutputFPS() + " fps"); System.out.println("Process input frame rate: " + getInputFPS() + " fps"); System.out.println("Total frame rate: " + getTotalFPS() + " fps"); System.out.println(); resetFPSTiming(); } - } - - if (PDebug.debugPrintUsedMemory) { - if (framesProcessed % printResultsFrameRate == 0) { - System.out.println("Approximate used memory: " + getApproximateUsedMemory() / 1024 + " k"); + + if (PDebug.debugPrintUsedMemory) { + System.out.println("Approximate used memory: " + getApproximateUsedMemory() / 1024 + " k"); } } --~--~---------~--~----~------------~-------~--~----~ Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en -~----------~----~----~----~------~----~------~--~---