File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
common-tools/clas-detector/src/main/java/org/jlab/detector/swaps Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -70,13 +70,14 @@ public SwapTable(IndexedTable fromTrans,IndexedTable toTrans) {
70
70
71
71
this .table = new IndexedTable (VAR_NAMES .length ,String .join (":" ,VAR_NAMES ));
72
72
73
- for (int row =0 ; row <fromTrans .getRowCount (); row ++) {
73
+ // loop over the rows in the translation table:
74
+ for (Object key : fromTrans .getList ().getMap ().keySet ()) {
74
75
75
- // crate/slot/channel is the base for mapping between the two tables :
76
- final int crate = Integer . parseInt (( String ) fromTrans . getValueAt ( row , 0 ) );
77
- final int slot = Integer . parseInt (( String ) fromTrans . getValueAt ( row , 1 ) );
78
- final int channel = Integer . parseInt (( String ) fromTrans . getValueAt ( row , 2 ) );
79
- final long hash = IndexedTable .DEFAULT_GENERATOR .hashCode (crate , slot , channel );
76
+ // get the hash for this row :
77
+ int crate = IndexedTable . DEFAULT_GENERATOR . getIndex (( long ) key , 0 );
78
+ int slot = IndexedTable . DEFAULT_GENERATOR . getIndex (( long ) key , 1 );
79
+ int channel = IndexedTable . DEFAULT_GENERATOR . getIndex (( long ) key , 2 );
80
+ long hash = IndexedTable .DEFAULT_GENERATOR .hashCode (crate , slot , channel );
80
81
81
82
// load the previous and current values of sector/layer/component/order:
82
83
boolean diff = false ;
You can’t perform that action at this time.
0 commit comments