Good Programming Tactics #### Avoid IF statements << void increaseTimeCount( int value, int type ) { int[] a = ... ; int minIndex; int maxIndex; int avgIndex; if (type == TYPE_A) { minIndex = 0; maxIndex = 1; avgIndex = 2; } else if (type == TYPE_B) { minIndex = 3; maxIndex = 4; avgIndex = 5; } ... a[minIndex] = Math.min(a[minIndex],value); ... } >> Should make type an offset (0 or 3): << void increaseTimeCount( int type ) { static final MIN_INDEX = 0; static final MAX_INDEX = 1; static final AVG_INDEX = 2; int[] a = ... ; ... a[MIN_INDEX+type] = Math.min(a[MIN_INDEX+type],value); ... >>