Oops; minor optimization in indexOf().

git-svn-id: https://samskivert.googlecode.com/svn/trunk@963 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
shaper
2002-12-05 22:14:52 +00:00
parent ea61e20a52
commit 2e172108be
@@ -1,5 +1,5 @@
//
// $Id: ArrayUtil.java,v 1.21 2002/12/05 22:11:03 shaper Exp $
// $Id: ArrayUtil.java,v 1.22 2002/12/05 22:14:52 shaper Exp $
//
// samskivert library - useful routines for java programs
// Copyright (C) 2001 Walter Korman
@@ -136,14 +136,13 @@ public class ArrayUtil
*/
public static int indexOf (float[] values, float value)
{
int idx = -1;
int count = (values == null) ? 0 : values.length;
for (int ii = 0; ii < count; ii++) {
if (values[ii] == value) {
return ii;
}
}
return idx;
return -1;
}
/**