Skip to content

Commit 1cc57ef

Browse files
committed
Reuse ArrayUtils.contains()
1 parent 715ecb7 commit 1cc57ef

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

src/test/java/org/apache/commons/codec/binary/BaseNTestData.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import java.util.Random;
2323

2424
import org.apache.commons.io.IOUtils;
25+
import org.apache.commons.lang3.ArrayUtils;
2526

2627
/**
2728
* Data and functions common to BaseN tests.
@@ -88,12 +89,7 @@ public class BaseNTestData {
8889
* @return true if bytes contains c, false otherwise
8990
*/
9091
static boolean bytesContain(final byte[] bytes, final byte c) {
91-
for (final byte b : bytes) {
92-
if (b == c) {
93-
return true;
94-
}
95-
}
96-
return false;
92+
return ArrayUtils.contains(bytes, c);
9793
}
9894

9995
private static int[] fill(final byte[] buf, final int offset, final InputStream in)

0 commit comments

Comments
 (0)