Skip to content

Commit

Permalink
refactor: Use small_vector in surfaceOnApproach (#1120)
Browse files Browse the repository at this point in the history
very uncontroversial
  • Loading branch information
paulgessinger committed Dec 15, 2021
1 parent ae508f3 commit 6d6d4f0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Core/src/Geometry/GenericApproachDescriptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

#include <algorithm>

#include <boost/container/small_vector.hpp>

void Acts::GenericApproachDescriptor::registerLayer(const Layer& lay) {
// go through the surfaces
for (auto& sf : m_surfaceCache) {
Expand All @@ -25,7 +27,8 @@ Acts::ObjectIntersection<Acts::Surface>
Acts::GenericApproachDescriptor::approachSurface(
const GeometryContext& gctx, const Vector3& position,
const Vector3& direction, const BoundaryCheck& bcheck) const {
std::vector<ObjectIntersection<Surface>> sIntersections;
// almost always 2
boost::container::small_vector<ObjectIntersection<Surface>, 2> sIntersections;
sIntersections.reserve(m_surfaceCache.size());
for (auto& sf : m_surfaceCache) {
auto sfIntersection = sf->intersect(gctx, position, direction, bcheck);
Expand Down

0 comments on commit 6d6d4f0

Please sign in to comment.