From ba1e0835896f5190fc3051d58ed0a1a384bb35c3 Mon Sep 17 00:00:00 2001 From: mikaelpeltier Date: Thu, 26 Mar 2015 13:23:44 +0100 Subject: Simplify set and get method of IntList to enable Jit inlining Change-Id: Ia28ac670894233f7434053b66fb8d6664f92d2fa --- dx/src/com/android/jack/dx/util/IntList.java | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) (limited to 'dx') diff --git a/dx/src/com/android/jack/dx/util/IntList.java b/dx/src/com/android/jack/dx/util/IntList.java index 36e96d05..415dea47 100644 --- a/dx/src/com/android/jack/dx/util/IntList.java +++ b/dx/src/com/android/jack/dx/util/IntList.java @@ -169,16 +169,7 @@ public final class IntList extends MutabilityControl { * @return the indicated element's value */ public int get(int n) { - if (n >= size) { - throw new IndexOutOfBoundsException("n >= size()"); - } - - try { return values[n]; - } catch (ArrayIndexOutOfBoundsException ex) { - // Translate exception. - throw new IndexOutOfBoundsException("n < 0"); - } } /** @@ -189,20 +180,8 @@ public final class IntList extends MutabilityControl { */ public void set(int n, int value) { throwIfImmutable(); - - if (n >= size) { - throw new IndexOutOfBoundsException("n >= size()"); - } - - try { - values[n] = value; - sorted = false; - } catch (ArrayIndexOutOfBoundsException ex) { - // Translate the exception. - if (n < 0) { - throw new IllegalArgumentException("n < 0"); - } - } + values[n] = value; + sorted = false; } /** -- cgit v1.2.3