summaryrefslogtreecommitdiff
path: root/src/mongo/idl
diff options
context:
space:
mode:
authorBilly Donahue <billy.donahue@mongodb.com>2018-04-02 17:01:35 -0400
committerBilly Donahue <billy.donahue@mongodb.com>2018-04-02 20:04:36 -0400
commita16f90edd5339d3f58bec24e2a1639c0b2fd938e (patch)
tree1142d5c3bc277ca44b407dd28fa04e8303b8867f /src/mongo/idl
parentc872bdd8d24a7beb9df42cbe227e99d6738ba71e (diff)
downloadmongo-a16f90edd5339d3f58bec24e2a1639c0b2fd938e.tar.gz
SERVER-34179 refactor isGenericArgument
Remove the static tables floating around at namespace scope. break CommandHelpers::isGenericArgument into command_generic_argument library so it doesn't have to be inline. Some callers depend on it but would have a circularity if they actually added db/commands to their LIBDEPS.
Diffstat (limited to 'src/mongo/idl')
-rw-r--r--src/mongo/idl/SConscript1
-rw-r--r--src/mongo/idl/idl_parser.cpp4
2 files changed, 3 insertions, 2 deletions
diff --git a/src/mongo/idl/SConscript b/src/mongo/idl/SConscript
index 87c5d3c2158..b7fdf916c29 100644
--- a/src/mongo/idl/SConscript
+++ b/src/mongo/idl/SConscript
@@ -10,6 +10,7 @@ env.Library(
],
LIBDEPS=[
'$BUILD_DIR/mongo/base',
+ '$BUILD_DIR/mongo/db/command_generic_argument',
]
)
diff --git a/src/mongo/idl/idl_parser.cpp b/src/mongo/idl/idl_parser.cpp
index a8b591a43db..1ec3ed93459 100644
--- a/src/mongo/idl/idl_parser.cpp
+++ b/src/mongo/idl/idl_parser.cpp
@@ -33,7 +33,7 @@
#include "mongo/idl/idl_parser.h"
#include "mongo/bson/bsonobjbuilder.h"
-#include "mongo/db/commands.h"
+#include "mongo/db/command_generic_argument.h"
#include "mongo/util/mongoutils/str.h"
namespace mongo {
@@ -247,7 +247,7 @@ void IDLParserErrorContext::appendGenericCommandArguments(
StringData name = element.fieldNameStringData();
// Include a passthrough field as long the IDL class has not defined it.
- if (CommandHelpers::isGenericArgument(name) &&
+ if (mongo::isGenericArgument(name) &&
std::find(knownFields.begin(), knownFields.end(), name) == knownFields.end()) {
builder->append(element);
}