Skip to content

Commit

Permalink
Use Comparator in FieldValue. (#686)
Browse files Browse the repository at this point in the history
  • Loading branch information
wilhuff authored and zxu123 committed Jan 19, 2018
1 parent 39d8252 commit cd0cbe9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Firestore/core/src/firebase/firestore/model/field_value.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@
#include <utility>
#include <vector>

#include "Firestore/core/src/firebase/firestore/util/comparison.h"
#include "Firestore/core/src/firebase/firestore/util/firebase_assert.h"

using firebase::firestore::util::Comparator;

namespace firebase {
namespace firestore {
namespace model {
Expand Down Expand Up @@ -137,8 +140,7 @@ bool operator<(const FieldValue& lhs, const FieldValue& rhs) {
case Type::Null:
return false;
case Type::Boolean:
// lhs < rhs iff lhs == false and rhs == true.
return !lhs.boolean_value_ && rhs.boolean_value_;
return Comparator<bool>()(lhs.boolean_value_, rhs.boolean_value_);
case Type::Array:
return lhs.array_value_ < rhs.array_value_;
default:
Expand Down

0 comments on commit cd0cbe9

Please sign in to comment.