git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
JAL-2999 release date for 2.10.4b1 set for 27th May 2018
[jalview.git]
/
src
/
jalview
/
ext
/
android
/
SparseDoubleArray.java
diff --git
a/src/jalview/ext/android/SparseDoubleArray.java
b/src/jalview/ext/android/SparseDoubleArray.java
index
5ae5afe
..
eaf059c
100644
(file)
--- a/
src/jalview/ext/android/SparseDoubleArray.java
+++ b/
src/jalview/ext/android/SparseDoubleArray.java
@@
-425,13
+425,17
@@
public class SparseDoubleArray implements Cloneable
* @oparam toAdd
* @return the new value for the key
*/
* @oparam toAdd
* @return the new value for the key
*/
- public double multiply(int key, double d)
+ public double divide(int key, double divisor)
{
double newValue = 0d;
{
double newValue = 0d;
+ if (divisor == 0d)
+ {
+ return newValue;
+ }
int i = ContainerHelpers.binarySearch(mKeys, mSize, key);
if (i >= 0)
{
int i = ContainerHelpers.binarySearch(mKeys, mSize, key);
if (i >= 0)
{
- mValues[i] *= d;
+ mValues[i] /= divisor;
newValue = mValues[i];
}
return newValue;
newValue = mValues[i];
}
return newValue;