Use interface instead of type alias for TRow

This commit is contained in:
Asger F
2024-11-22 12:46:09 +01:00
parent 62f3b4f696
commit 9800fa1333

View File

@@ -295,12 +295,12 @@ function HighLevelStats(props: HighLevelStatsProps) {
);
}
type TRow = {
interface TRow {
name: string;
before: PredicateInfo;
after: PredicateInfo;
diff: number;
};
}
function getSortOrder(sortOrder: "delta" | "absDelta") {
if (sortOrder === "absDelta") {
@@ -413,7 +413,7 @@ function ComparePerformanceWithData(props: {
const hasCacheHitMismatch = useRef(false);
const rows = useMemo(() => {
const rows: TRow[] = useMemo(() => {
hasCacheHitMismatch.current = false;
return Array.from(nameSet)
.map((name) => {
@@ -434,7 +434,7 @@ function ComparePerformanceWithData(props: {
}
}
const diff = afterValue - beforeValue;
return { name, before, after, diff };
return { name, before, after, diff } satisfies TRow;
})
.filter((x) => !!x)
.sort(getSortOrder(sortOrder));