Skip to content

Commit 5b6f63b

Browse files
committed
extract closure to add metadata to tooltips
1 parent 1ad343e commit 5b6f63b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

site/frontend/src/pages/compare/compile/comparisons-table.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@ Category: ${metadata.category}
7373
if (metadata.iterations !== null) {
7474
tooltip += `Iterations: ${metadata.iterations}\n`;
7575
}
76-
if (testCase.profile === "opt" && metadata.release_profile !== null) {
77-
const {lto, debug, codegen_units} = metadata.release_profile;
76+
const addMetadata = ({lto, debug, codegen_units}) => {
7877
if (lto !== null) {
7978
tooltip += `LTO: ${lto}\n`;
8079
}
@@ -84,6 +83,9 @@ Category: ${metadata.category}
8483
if (codegen_units !== null) {
8584
tooltip += `Codegen units: ${codegen_units}\n`;
8685
}
86+
};
87+
if (testCase.profile === "opt" && metadata.release_profile !== null) {
88+
addMetadata(metadata.release_profile);
8789
}
8890
8991
return tooltip;

0 commit comments

Comments
 (0)