Skip to content

Commit

Permalink
Remove pass by const reference when std::move-ing
Browse files Browse the repository at this point in the history
  • Loading branch information
VourMa committed Aug 16, 2024
1 parent 4ff4aaf commit 8d2366b
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 51 deletions.
17 changes: 8 additions & 9 deletions RecoTracker/LST/interface/LSTOutput.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@
class LSTOutput {
public:
LSTOutput() = default;
LSTOutput(std::vector<std::vector<unsigned int>> const& hitIdx,
std::vector<unsigned int> const& len,
std::vector<int> const& seedIdx,
std::vector<short> const& trackCandidateType) {
hitIdx_ = std::move(hitIdx);
len_ = std::move(len);
seedIdx_ = std::move(seedIdx);
trackCandidateType_ = std::move(trackCandidateType);
}
LSTOutput(std::vector<std::vector<unsigned int>> const hitIdx,
std::vector<unsigned int> const len,
std::vector<int> const seedIdx,
std::vector<short> const trackCandidateType)
: hitIdx_(std::move(hitIdx)),
len_(std::move(len)),
seedIdx_(std::move(seedIdx)),
trackCandidateType_(std::move(trackCandidateType)) {}

~LSTOutput() = default;

Expand Down
17 changes: 6 additions & 11 deletions RecoTracker/LST/interface/LSTPhase2OTHitsInput.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,12 @@
class LSTPhase2OTHitsInput {
public:
LSTPhase2OTHitsInput() = default;
LSTPhase2OTHitsInput(std::vector<unsigned int> const& detId,
std::vector<float> const& x,
std::vector<float> const& y,
std::vector<float> const& z,
std::vector<TrackingRecHit const*> const& hits) {
detId_ = std::move(detId);
x_ = std::move(x);
y_ = std::move(y);
z_ = std::move(z);
hits_ = std::move(hits);
}
LSTPhase2OTHitsInput(std::vector<unsigned int> const detId,
std::vector<float> const x,
std::vector<float> const y,
std::vector<float> const z,
std::vector<TrackingRecHit const*> const hits)
: detId_(std::move(detId)), x_(std::move(x)), y_(std::move(y)), z_(std::move(z)), hits_(std::move(hits)) {}

~LSTPhase2OTHitsInput() = default;

Expand Down
61 changes: 30 additions & 31 deletions RecoTracker/LST/interface/LSTPixelSeedInput.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,36 @@
class LSTPixelSeedInput {
public:
LSTPixelSeedInput() = default;
LSTPixelSeedInput(std::vector<float> const& px,
std::vector<float> const& py,
std::vector<float> const& pz,
std::vector<float> const& dxy,
std::vector<float> const& dz,
std::vector<float> const& ptErr,
std::vector<float> const& etaErr,
std::vector<float> const& stateTrajGlbX,
std::vector<float> const& stateTrajGlbY,
std::vector<float> const& stateTrajGlbZ,
std::vector<float> const& stateTrajGlbPx,
std::vector<float> const& stateTrajGlbPy,
std::vector<float> const& stateTrajGlbPz,
std::vector<int> const& q,
std::vector<std::vector<int>> const& hitIdx) {
px_ = std::move(px);
py_ = std::move(py);
pz_ = std::move(pz);
dxy_ = std::move(dxy);
dz_ = std::move(dz);
ptErr_ = std::move(ptErr);
etaErr_ = std::move(etaErr);
stateTrajGlbX_ = std::move(stateTrajGlbX);
stateTrajGlbY_ = std::move(stateTrajGlbY);
stateTrajGlbZ_ = std::move(stateTrajGlbZ);
stateTrajGlbPx_ = std::move(stateTrajGlbPx);
stateTrajGlbPy_ = std::move(stateTrajGlbPy);
stateTrajGlbPz_ = std::move(stateTrajGlbPz);
q_ = std::move(q);
hitIdx_ = std::move(hitIdx);
}
LSTPixelSeedInput(std::vector<float> const px,
std::vector<float> const py,
std::vector<float> const pz,
std::vector<float> const dxy,
std::vector<float> const dz,
std::vector<float> const ptErr,
std::vector<float> const etaErr,
std::vector<float> const stateTrajGlbX,
std::vector<float> const stateTrajGlbY,
std::vector<float> const stateTrajGlbZ,
std::vector<float> const stateTrajGlbPx,
std::vector<float> const stateTrajGlbPy,
std::vector<float> const stateTrajGlbPz,
std::vector<int> const q,
std::vector<std::vector<int>> const hitIdx)
: px_(std::move(px)),
py_(std::move(py)),
pz_(std::move(pz)),
dxy_(std::move(dxy)),
dz_(std::move(dz)),
ptErr_(std::move(ptErr)),
etaErr_(std::move(etaErr)),
stateTrajGlbX_(std::move(stateTrajGlbX)),
stateTrajGlbY_(std::move(stateTrajGlbY)),
stateTrajGlbZ_(std::move(stateTrajGlbZ)),
stateTrajGlbPx_(std::move(stateTrajGlbPx)),
stateTrajGlbPy_(std::move(stateTrajGlbPy)),
stateTrajGlbPz_(std::move(stateTrajGlbPz)),
q_(std::move(q)),
hitIdx_(std::move(hitIdx)) {}

~LSTPixelSeedInput() = default;

Expand Down

0 comments on commit 8d2366b

Please sign in to comment.