mirror of
https://bitbucket.org/Mattrixwv/javaclasses.git
synced 2025-12-06 23:13:57 -05:00
Fixed a bug in the isFound functions where
it would return false negatives
This commit is contained in:
Binary file not shown.
@@ -734,7 +734,7 @@ public class Algorithms{
|
||||
//Look through every element in the array, looing for the key element
|
||||
for(Integer num : ary){
|
||||
//If there is an element in the array that is the same as key return true
|
||||
if(num == key){
|
||||
if(num.equals(key)){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -745,7 +745,7 @@ public class Algorithms{
|
||||
//Look through every element in the array, looing for the key element
|
||||
for(Long num : ary){
|
||||
//If there is an element in the array that is the same as key return true
|
||||
if(num == key){
|
||||
if(num.equals(key)){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -756,7 +756,7 @@ public class Algorithms{
|
||||
//Look through every element in the array, looing for the key element
|
||||
for(BigInteger num : ary){
|
||||
//If there is an element in the array that is the same as key return true
|
||||
if(num == key){
|
||||
if(num.equals(key)){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user