From bddae870d4024f5e1455903dc412bf915c450641 Mon Sep 17 00:00:00 2001 From: ray Date: Tue, 29 Jul 2003 23:50:07 +0000 Subject: [PATCH] Made the rangeCheck logic a bit easier for humans to parse. git-svn-id: https://samskivert.googlecode.com/svn/trunk@1180 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- .../src/java/com/samskivert/util/SortableArrayList.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/samskivert/src/java/com/samskivert/util/SortableArrayList.java b/projects/samskivert/src/java/com/samskivert/util/SortableArrayList.java index 07c68290..9320783e 100644 --- a/projects/samskivert/src/java/com/samskivert/util/SortableArrayList.java +++ b/projects/samskivert/src/java/com/samskivert/util/SortableArrayList.java @@ -1,5 +1,5 @@ // -// $Id: SortableArrayList.java,v 1.17 2003/07/29 23:44:14 ray Exp $ +// $Id: SortableArrayList.java,v 1.18 2003/07/29 23:50:07 ray Exp $ // // samskivert library - useful routines for java programs // Copyright (C) 2001 Michael Bayne @@ -240,7 +240,7 @@ public class SortableArrayList extends AbstractList */ protected void rangeCheck (int index, boolean insert) { - if ((index < 0) || (index > _size) || (!insert && index == _size)) { + if ((index < 0) || (insert ? (index > _size) : (index >= _size))) { throw new IndexOutOfBoundsException( "Index: " + index + ", Size: " + _size); }