Skip to content

Commit 39a2e73

Browse files
committed
Change parameter for U.times(count, supplier).
1 parent b3fc05a commit 39a2e73

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/main/java/com/github/underscore/U.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2548,9 +2548,9 @@ public boolean test(final Map<K, V> item) {
25482548
/*
25492549
* Documented, #times
25502550
*/
2551-
public static <E> void times(final int count, final Supplier<E> function) {
2551+
public static <E> void times(final int count, final Runnable runnable) {
25522552
for (int index = 0; index < count; index += 1) {
2553-
function.get();
2553+
runnable.run();
25542554
}
25552555
}
25562556

src/test/java/com/github/underscore/UtilityTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,9 @@ public void uniquePassword() {
145145
@Test
146146
public void times() {
147147
final List<Integer> result = new ArrayList<Integer>();
148-
U.times(3, new Supplier<Integer>() {
149-
public Integer get() {
148+
U.times(3, new Runnable() {
149+
public void run() {
150150
result.add(1);
151-
return null;
152151
}
153152
});
154153
assertEquals("[1, 1, 1]", result.toString());

0 commit comments

Comments
 (0)