diff options
author | Billy Donahue <billy.donahue@mongodb.com> | 2018-04-02 17:01:35 -0400 |
---|---|---|
committer | Billy Donahue <billy.donahue@mongodb.com> | 2018-04-02 20:04:36 -0400 |
commit | a16f90edd5339d3f58bec24e2a1639c0b2fd938e (patch) | |
tree | 1142d5c3bc277ca44b407dd28fa04e8303b8867f /src/mongo/bson | |
parent | c872bdd8d24a7beb9df42cbe227e99d6738ba71e (diff) | |
download | mongo-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/bson')
-rw-r--r-- | src/mongo/bson/util/bson_check.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mongo/bson/util/bson_check.h b/src/mongo/bson/util/bson_check.h index 4e290024824..2c1ae510d01 100644 --- a/src/mongo/bson/util/bson_check.h +++ b/src/mongo/bson/util/bson_check.h @@ -29,6 +29,7 @@ #pragma once #include "mongo/base/status.h" +#include "mongo/db/command_generic_argument.h" #include "mongo/db/commands.h" #include "mongo/db/jsobj.h" #include "mongo/util/mongoutils/str.h" @@ -91,7 +92,7 @@ Status bsonCheckOnlyHasFieldsForCommand(StringData objectName, const BSONObj& obj, const Container& allowedFields) { return bsonCheckOnlyHasFieldsImpl(objectName, obj, [&](StringData name) { - return CommandHelpers::isGenericArgument(name) || + return isGenericArgument(name) || (std::find(std::begin(allowedFields), std::end(allowedFields), name) != std::end(allowedFields)); }); |