diff options
| author | David Storch <david.storch@10gen.com> | 2016-08-12 15:58:56 -0400 |
|---|---|---|
| committer | David Storch <david.storch@10gen.com> | 2016-08-18 11:14:17 -0400 |
| commit | 26543060c852aac22f26143a04bf7789ec8fec53 (patch) | |
| tree | df3ae49e5c4745058be29b7ec8a8e4b528b50a9a /src/mongo/executor/remote_command_request.cpp | |
| parent | 13fa28982d008568f7620d73ddec0c61fad7cbc8 (diff) | |
| download | mongo-26543060c852aac22f26143a04bf7789ec8fec53.tar.gz | |
SERVER-24508 BSONObj::ComparatorInterface
BSONObj instances should now be compared via the comparator
interface's evaluate() method. This preferred over using
BSONObj::woCompare() directly. If the comparison doesn't
require any database semantics (e.g. there is no collation),
there is a global instance of the SimpleBSONObjComparator
which should be used for BSONObj comparisons. If the
comparison requires special semantics, then callers must
instantiate their own comparator object.
Diffstat (limited to 'src/mongo/executor/remote_command_request.cpp')
| -rw-r--r-- | src/mongo/executor/remote_command_request.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mongo/executor/remote_command_request.cpp b/src/mongo/executor/remote_command_request.cpp index 613b5ac5824..e1028ae320a 100644 --- a/src/mongo/executor/remote_command_request.cpp +++ b/src/mongo/executor/remote_command_request.cpp @@ -32,6 +32,7 @@ #include <ostream> +#include "mongo/bson/simple_bsonobj_comparator.h" #include "mongo/platform/atomic_word.h" #include "mongo/util/mongoutils/str.h" @@ -95,8 +96,10 @@ bool RemoteCommandRequest::operator==(const RemoteCommandRequest& rhs) const { if (this == &rhs) { return true; } - return target == rhs.target && dbname == rhs.dbname && cmdObj == rhs.cmdObj && - metadata == rhs.metadata && timeout == rhs.timeout; + return target == rhs.target && dbname == rhs.dbname && + SimpleBSONObjComparator::kInstance.evaluate(cmdObj == rhs.cmdObj) && + SimpleBSONObjComparator::kInstance.evaluate(metadata == rhs.metadata) && + timeout == rhs.timeout; } bool RemoteCommandRequest::operator!=(const RemoteCommandRequest& rhs) const { |
