Skip to content

Commit c06df5b

Browse files
committed
modernize-avoid-c-arrays
1 parent 7201244 commit c06df5b

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464

6565
#include <RtypesCore.h>
6666

67+
#include <array>
6768
#include <cstdint>
6869
#include <cstdlib>
6970
#include <iostream>
@@ -1480,7 +1481,7 @@ struct TableMakerMC {
14801481
}
14811482
}
14821483
}
1483-
int daughterRange[2] = {-1, -1};
1484+
std::array<int, 2> daughterRange{-1, -1};
14841485
if (!daughters.empty()) {
14851486
daughterRange[0] = daughters[0];
14861487
daughterRange[1] = daughters[daughters.size() - 1];
@@ -1564,7 +1565,7 @@ struct TableMakerMC {
15641565
for (auto cut = fTrackCuts.begin(); cut != fTrackCuts.end(); cut++, ib++) {
15651566
histTracks->GetXaxis()->SetBinLabel(ib, (*cut)->GetName());
15661567
}
1567-
const char* v0TagNames[5] = {"Photon conversion", "K^{0}_{s}", "#Lambda", "#bar{#Lambda}", "#Omega"};
1568+
constexpr std::array<const char*, 5> v0TagNames = {"Photon conversion", "K^{0}_{s}", "#Lambda", "#bar{#Lambda}", "#Omega"};
15681569
for (int ib = 0; ib < 5; ib++) {
15691570
histTracks->GetXaxis()->SetBinLabel(fTrackCuts.size() + 1 + ib, v0TagNames[ib]);
15701571
}

PWGDQ/TableProducer/tableMaker_withAssoc.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ struct TableMaker {
692692
for (auto cut = fTrackCuts.begin(); cut != fTrackCuts.end(); cut++, ib++) {
693693
histTracks->GetXaxis()->SetBinLabel(ib, (*cut)->GetName());
694694
}
695-
const char* v0TagNames[5] = {"Photon conversion", "K^{0}_{s}", "#Lambda", "#bar{#Lambda}", "#Omega"};
695+
constexpr std::array<const char*, 5> v0TagNames = {"Photon conversion", "K^{0}_{s}", "#Lambda", "#bar{#Lambda}", "#Omega"};
696696
for (ib = 0; ib < 5; ib++) {
697697
histTracks->GetXaxis()->SetBinLabel(fTrackCuts.size() + 1 + ib, v0TagNames[ib]);
698698
}

0 commit comments

Comments
 (0)