From 09df698ffe3da4843e04a8af6c8e5cde86c10295 Mon Sep 17 00:00:00 2001 From: Yuri Gorshenin Date: Mon, 24 Apr 2017 14:59:20 +0300 Subject: [PATCH] Review fixes. --- 3party/jansson/myjansson.hpp | 6 +++--- search/search_quality/sample.cpp | 9 ++------- .../search_quality/search_quality_tests/sample_test.cpp | 2 +- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/3party/jansson/myjansson.hpp b/3party/jansson/myjansson.hpp index e5657d120d..a95e2b875f 100644 --- a/3party/jansson/myjansson.hpp +++ b/3party/jansson/myjansson.hpp @@ -86,9 +86,9 @@ void FromJSONObject(json_t * root, std::string const & field, std::vector & r // The function tries to parse array of values from a value // corresponding to |field| in a json object corresponding to |root|. // Returns true when the value is non-null and array is successfully -// parsed. Returns false when there are no such |field| in a |root| -// or value is null. Also, the method may throw exception in case of -// json parsing errors. +// parsed. Returns false when there is no such |field| in the |root| +// or the value is null. Also, the method may throw an exception in +// case of json parsing errors. template bool FromJSONObjectOptional(json_t * root, std::string const & field, std::vector & result) { diff --git a/search/search_quality/sample.cpp b/search/search_quality/sample.cpp index e9037a1779..bc666f8012 100644 --- a/search/search_quality/sample.cpp +++ b/search/search_quality/sample.cpp @@ -11,7 +11,7 @@ #include "base/string_utils.hpp" #include -#include +#include #include #include #include @@ -126,12 +126,7 @@ bool Sample::operator<(Sample const & rhs) const return Less(m_results, rhs.m_results); } -bool Sample::operator==(Sample const & rhs) const -{ - return m_query == rhs.m_query && m_locale == rhs.m_locale && m_pos == rhs.m_pos && - m_posAvailable == rhs.m_posAvailable && m_viewport == rhs.m_viewport && - Equal(m_results, rhs.m_results); -} +bool Sample::operator==(Sample const & rhs) const { return !(*this < rhs) && !(rhs < *this); } // static bool Sample::DeserializeFromJSONLines(string const & lines, std::vector & samples) diff --git a/search/search_quality/search_quality_tests/sample_test.cpp b/search/search_quality/search_quality_tests/sample_test.cpp index 60e9a45ba5..542e50892d 100644 --- a/search/search_quality/search_quality_tests/sample_test.cpp +++ b/search/search_quality/search_quality_tests/sample_test.cpp @@ -2,7 +2,7 @@ #include "search/search_quality/sample.hpp" -#include "base/logging.hpp" +#include "base/string_utils.hpp" #include #include