Skip to content

Commit 1170042

Browse files
authored
Copy over the profile meta when merging profiles (#5131)
1 parent d12a3a0 commit 1170042

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/profile-logic/merge-compare.js

+12
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,18 @@ export function mergeProfilesForDiffing(
9090
}
9191

9292
const resultProfile = getEmptyProfile();
93+
94+
// Copy over identical values for the ProfileMeta.
95+
for (const [key, value] of Object.entries(profiles[0].meta)) {
96+
if (profiles.every((profile) => profile.meta[key] === value)) {
97+
resultProfile.meta[key] = value;
98+
}
99+
}
100+
// Ensure it has a copy of the marker schema and categories, even though these could
101+
// be different between the two profiles.
102+
resultProfile.meta.markerSchema = profiles[0].meta.markerSchema;
103+
resultProfile.meta.categories = profiles[0].meta.categories;
104+
93105
resultProfile.meta.interval = Math.min(
94106
...profiles.map((profile) => profile.meta.interval)
95107
);

0 commit comments

Comments
 (0)