Skip to content

Commit

Permalink
fix script
Browse files Browse the repository at this point in the history
Signed-off-by: Jade Abraham <[email protected]>
  • Loading branch information
jabraham17 committed Aug 28, 2024
1 parent a782428 commit cdfe707
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tools/unstableWarningAnonymizer/unstableAnonScript.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ import Set.set;
import Sort;
import Regex.regex;
import ArgumentParser;
use Sort only relativeComparator;

proc countUniqueWarnings(ref warningsMap: map(string, ?t),
inputFileReader: IO.fileReader(?)
Expand Down Expand Up @@ -165,10 +166,9 @@ inline proc csvPrintArr(arr: [] (string, int, int),
}

// Comparator to sort our array representation of the map
// by the number of occurences of each warning
record occurenceComparator {}
occurenceComparator implements relativeComparator
proc occurenceComparator.compare(a: (string, int, int), b: (string, int, int)){
// by the number of occurrences of each warning
record occurrenceComparator: relativeComparator {}
proc occurrenceComparator.compare(a: (string, int, int), b: (string, int, int)){
return b[1] - a[1]; // Reverse sort
}

Expand All @@ -184,7 +184,7 @@ proc convertMapToArray(const m: map(string, ?t), sorted: bool, topX: int)
a = (key, m[key][0], m[key][1].size);
}
if sorted {
var comp: occurenceComparator;
var comp: occurrenceComparator;
Sort.sort(arr, comparator=comp);
} else {
var comp: warningComparator;
Expand Down

0 comments on commit cdfe707

Please sign in to comment.