ports/databases/mongodb70/files/patch-src_mongo_db_exec_near.cpp
Dimitry Andric 3d3f9b4f57
databases/mongodb70: fix build on 14-current
Fixes provided by Dimitry in a private reply on https://lists.freebsd.org/archives/freebsd-ports/2023-May/003870.html. Dank je wel!

poidriere stage-qa ok
runtime tested: proper clean start and restart on existing db
2023-06-24 10:02:23 +02:00

46 lines
1.4 KiB
C++

--- src/mongo/db/exec/near.cpp.orig 2023-06-15 22:07:57 UTC
+++ src/mongo/db/exec/near.cpp
@@ -42,6 +42,21 @@ using std::vector;
using std::unique_ptr;
using std::vector;
+/**
+ * Holds a generic search result with a distance computed in some fashion.
+ */
+struct NearStage::SearchResult {
+ SearchResult(WorkingSetID resultID, double distance) : resultID(resultID), distance(distance) {}
+
+ bool operator<(const SearchResult& other) const {
+ // We want increasing distance, not decreasing, so we reverse the <
+ return distance > other.distance;
+ }
+
+ WorkingSetID resultID;
+ double distance;
+};
+
NearStage::NearStage(ExpressionContext* expCtx,
const char* typeName,
StageType type,
@@ -113,21 +128,6 @@ PlanStage::StageState NearStage::doWork(WorkingSetID*
return nextState;
}
-
-/**
- * Holds a generic search result with a distance computed in some fashion.
- */
-struct NearStage::SearchResult {
- SearchResult(WorkingSetID resultID, double distance) : resultID(resultID), distance(distance) {}
-
- bool operator<(const SearchResult& other) const {
- // We want increasing distance, not decreasing, so we reverse the <
- return distance > other.distance;
- }
-
- WorkingSetID resultID;
- double distance;
-};
// Set "toReturn" when NEED_YIELD.
PlanStage::StageState NearStage::bufferNext(WorkingSetID* toReturn) {