File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
common-tools/clas-detector/src/main/java/org/jlab/detector/decode Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -246,10 +246,17 @@ public void filterTDCs(List<DetectorDataDgtz> detectorData){
246246 class TDCComparator implements Comparator <DetectorDataDgtz > {
247247
248248 // override the compare() method
249+ @ Override
249250 public int compare (DetectorDataDgtz s1 , DetectorDataDgtz s2 )
250- {
251- if (s1 .getTDCSize ()>0 && s2 .getTDCSize ()>0 )
252- return s1 .getTDCData (0 ).getTime ()<s2 .getTDCData (0 ).getTime () ? -1 : 1 ;
251+ {
252+ if (s1 .getTDCSize ()>0 && s2 .getTDCSize ()>0 ) {
253+ if (s1 .getTDCData (0 ).getTime () < s2 .getTDCData (0 ).getTime ())
254+ return -1 ;
255+ else if (s1 .getTDCData (0 ).getTime () > s2 .getTDCData (0 ).getTime ())
256+ return 1 ;
257+ else
258+ return 0 ;
259+ }
253260 else if (s1 .getTDCSize ()>0 )
254261 return 1 ;
255262 else if (s2 .getTDCSize ()>0 )
You can’t perform that action at this time.
0 commit comments