From ea38e5eeb7fda88ddf1e534c3c423772c9a73971 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Fri, 12 Aug 2022 02:03:00 -0400 Subject: [PATCH] fix missing move fix clip_back causing extra copies --- include/common/polylib.hh | 2 +- qbsp/brushbsp.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/common/polylib.hh b/include/common/polylib.hh index af496e16..7cf2e94d 100644 --- a/include/common/polylib.hh +++ b/include/common/polylib.hh @@ -1124,7 +1124,7 @@ public: ================== */ std::optional clip_back( - const qplane3d &plane, const vec_t &on_epsilon = DEFAULT_ON_EPSILON, const bool &keepon = false) const + const qplane3d &plane, const vec_t &on_epsilon = DEFAULT_ON_EPSILON, const bool &keepon = false) { vec_t *dists = (vec_t *)alloca(sizeof(vec_t) * (size() + 1)); planeside_t *sides = (planeside_t *)alloca(sizeof(planeside_t) * (size() + 1)); diff --git a/qbsp/brushbsp.cc b/qbsp/brushbsp.cc index 066b44f2..e63f402b 100644 --- a/qbsp/brushbsp.cc +++ b/qbsp/brushbsp.cc @@ -513,7 +513,7 @@ static twosided SplitBrush(bspbrush_t::ptr brush, size_t planen // add the clipped face to result[j] side_t faceCopy = face; - faceCopy.w = *cw[j]; + faceCopy.w = std::move(*cw[j]); // fixme-brushbsp: configure any settings on the faceCopy? // Q2 does `cs->tested = false;`, why?