瀏覽代碼

cleaned up method

Kaitrina High 6 年之前
父節點
當前提交
4f58c4323b
共有 1 個文件被更改,包括 1 次插入7 次删除
  1. 1
    7
      src/main/java/com/zipcodewilmington/arrayutility/ArrayUtility.java

+ 1
- 7
src/main/java/com/zipcodewilmington/arrayutility/ArrayUtility.java 查看文件

@@ -34,13 +34,7 @@ public class ArrayUtility<T> {
34 34
     }
35 35
 
36 36
     public Integer getNumberOfOccurrences(T valueToEvaluate) {
37
-        Integer count = 0;
38
-        for (T item : this.inputArray) {
39
-            if (item == valueToEvaluate) {
40
-                count++;
41
-            }
42
-        }
43
-        return count;
37
+         return getNumberOfOccurrences(this.inputArray, valueToEvaluate);
44 38
     }
45 39
 
46 40
     public Integer countDuplicatesInMerge(T[] arrayToMerge, T valueToEvaluate) {