Skip to content

Commit

Permalink
should be
Browse files Browse the repository at this point in the history
  • Loading branch information
Baunsgaard committed Oct 21, 2024
1 parent 15d8565 commit f083566
Showing 1 changed file with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Objects;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
Expand Down Expand Up @@ -936,12 +937,19 @@ public double[] minMax(int l, int u) {
public void setM(Map<T, Long> map, AMapToData m, int i){
m.set(i, map.get(get(i)).intValue() - 1);
}

public void setM(Map<T, Long> map, int si, AMapToData m, int i) {
final T v = get(i);
if(v != null)
m.set(i, map.get(v).intValue() - 1);
else
m.set(i, si);
try{

final T v = get(i);
if(v != null)
m.set(i, map.get(v).intValue() - 1);
else
m.set(i, si);
}
catch(Exception e) {
String error = "expected: " + get(i) + " to be in map: " + map;
throw new RuntimeException(error, e);
}
}
}

0 comments on commit f083566

Please sign in to comment.