Skip to content

Commit

Permalink
perfparser (addSampleToFrequencyData): const newsize
Browse files Browse the repository at this point in the history
  • Loading branch information
GitMensch committed Jan 10, 2024
1 parent c55a4f8 commit 58f4950
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/parsers/perf/perfparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1055,9 +1055,10 @@ class PerfParserPrivate : public QObject
for (const auto& cost : sample.costs) {
if (core.costs.size() <= cost.attributeId) {
const auto oldSize = core.costs.size();
core.costs.resize(cost.attributeId + 1);
const auto newSize = cost.attributeId + 1;
core.costs.resize(newSize);

for (int i = oldSize; i < core.costs.size(); i++) {
for (int i = oldSize; i < newSize; i++) {
core.costs[i].costName = strings.at(attributes[i].name.id);
}
}
Expand Down

0 comments on commit 58f4950

Please sign in to comment.