remove size() method; too slow

git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1592 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
This commit is contained in:
sjfink 2007-08-07 20:12:14 +00:00
parent 96d6e30b3b
commit 4bac3bbd1b
1 changed files with 8 additions and 11 deletions

View File

@ -29,7 +29,7 @@ public class SimpleIntVector implements IntVector {
int[] store;
final int defaultValue;
/**
* @param defaultValue
*/
@ -112,17 +112,14 @@ public class SimpleIntVector implements IntVector {
* @return the percentage of entries in delegateStore that are non-null
*/
private double computeOccupancy() {
int count = size();
int count1 = 0;
for (int i = 0; i < store.length; i++) {
if (store[i] != -1) {
count1++;
}
}
int count = count1;
return (double) count / (double) store.length;
}
public int size() {
int count = 0;
for (int i = 0; i < store.length; i++) {
if (store[i] != -1) {
count++;
}
}
return count;
}
}