Skip to content

Commit 0f6bc10

Browse files
Fabian Schenkmeta-codesync[bot]
authored andcommitted
constexpr in camera CompParameters
Summary: Behavior-preserving optimization (constexpr) for `geometry/camera.h`: - Mark `CompParameters::operator()` `constexpr` (pure comparator, only `static_cast` + `<`, literal `size_t` return). Additive; the operator was already implicitly inline. No observable behavior change. Verified by build + tests (205 passed). ___ Differential Revision: D108284669 fbshipit-source-id: cf43011ea0cb483306efe40c904d589edefa6bc1
1 parent c02c1be commit 0f6bc10

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

opensfm/src/geometry/camera.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ class Camera {
2828
};
2929

3030
struct CompParameters {
31-
size_t operator()(const Parameters& p1, const Parameters& p2) const {
31+
constexpr size_t operator()(const Parameters& p1,
32+
const Parameters& p2) const {
3233
return static_cast<size_t>(p1) < static_cast<size_t>(p2);
3334
}
3435
};

0 commit comments

Comments
 (0)