diff options
author | Jason Rassi <rassi@10gen.com> | 2015-03-09 15:46:42 -0400 |
---|---|---|
committer | Jason Rassi <rassi@10gen.com> | 2015-03-10 11:48:18 -0400 |
commit | c6c136a7def8ab1f78ccd5d53034af510436e776 (patch) | |
tree | a11e4cc7d8ac3c1b60095fcb9575ad2166447f54 /src/mongo/db/fts | |
parent | d36022a01c16cee954f76406001e9165213d42cd (diff) | |
download | mongo-c6c136a7def8ab1f78ccd5d53034af510436e776.tar.gz |
SERVER-17437 Remove unused fts::BSONElementMap, fts::FTSQuery::_search
Diffstat (limited to 'src/mongo/db/fts')
-rw-r--r-- | src/mongo/db/fts/SConscript | 3 | ||||
-rw-r--r-- | src/mongo/db/fts/fts_query.cpp | 1 | ||||
-rw-r--r-- | src/mongo/db/fts/fts_query.h | 2 | ||||
-rw-r--r-- | src/mongo/db/fts/fts_util.h | 40 | ||||
-rw-r--r-- | src/mongo/db/fts/fts_util_test.cpp | 48 |
5 files changed, 0 insertions, 94 deletions
diff --git a/src/mongo/db/fts/SConscript b/src/mongo/db/fts/SConscript index 5e63a6eda39..6ccc070fd64 100644 --- a/src/mongo/db/fts/SConscript +++ b/src/mongo/db/fts/SConscript @@ -83,6 +83,3 @@ env.CppUnitTest( "fts_matcher_test", "fts_matcher_test.cpp", env.CppUnitTest( "fts_element_iterator_test", "fts_element_iterator_test.cpp", LIBDEPS=["base"] ) - -env.CppUnitTest( "fts_util_test", "fts_util_test.cpp", - LIBDEPS=["base","$BUILD_DIR/mongo/mongohasher"] ) diff --git a/src/mongo/db/fts/fts_query.cpp b/src/mongo/db/fts/fts_query.cpp index 1e66a880cd4..d5004d00ce7 100644 --- a/src/mongo/db/fts/fts_query.cpp +++ b/src/mongo/db/fts/fts_query.cpp @@ -49,7 +49,6 @@ namespace mongo { Status FTSQuery::parse(const string& query, StringData language, TextIndexVersion textIndexVersion) { - _search = query; StatusWithFTSLanguage swl = FTSLanguage::make( language, textIndexVersion ); if ( !swl.getStatus().isOK() ) { return swl.getStatus(); diff --git a/src/mongo/db/fts/fts_query.h b/src/mongo/db/fts/fts_query.h index e1c3bcb3cc7..c436abb83a8 100644 --- a/src/mongo/db/fts/fts_query.h +++ b/src/mongo/db/fts/fts_query.h @@ -69,7 +69,6 @@ namespace mongo { _negatedPhrases.size() > 0; } - std::string getSearch() const { return _search; } const FTSLanguage& getLanguage() const { return *_language; } std::string toString() const; @@ -79,7 +78,6 @@ namespace mongo { BSONObj toBSON() const; protected: - std::string _search; const FTSLanguage* _language; std::vector<std::string> _terms; std::set<std::string> _negatedTerms; diff --git a/src/mongo/db/fts/fts_util.h b/src/mongo/db/fts/fts_util.h index 5a749b27f53..88a613b5c88 100644 --- a/src/mongo/db/fts/fts_util.h +++ b/src/mongo/db/fts/fts_util.h @@ -32,9 +32,7 @@ #include <string> -#include "mongo/db/hasher.h" #include "mongo/db/jsobj.h" -#include "mongo/util/unordered_fast_key_table.h" namespace mongo { @@ -57,44 +55,6 @@ namespace mongo { for ( std::string::size_type i = 0; i < sz; i++ ) (*s)[i] = (char)tolower( (int)(*s)[i] ); } - - struct _be_hash { - size_t operator()( const BSONElement& e ) const { - return static_cast<size_t>( BSONElementHasher::hash64( e, 17 ) ); - } - }; - - struct _be_equals { - bool operator()( const BSONElement& a, const BSONElement& b ) const { - return a == b; - } - }; - - struct _be_convert { - BSONElement operator()( const BSONObj& o ) const { - const BSONElement& x = o.firstElement(); - BSONElement y( x.rawdata() ); - return y; - } - }; - - struct _be_convert_other { - BSONObj operator()( const BSONElement& e ) const { - return e.wrap(); - } - }; - - template< typename V > - class BSONElementMap : public UnorderedFastKeyTable<BSONElement, - BSONObj, - V, - _be_hash, - _be_equals, - _be_convert, - _be_convert_other > { - }; - - } } diff --git a/src/mongo/db/fts/fts_util_test.cpp b/src/mongo/db/fts/fts_util_test.cpp deleted file mode 100644 index 381ed1bf86a..00000000000 --- a/src/mongo/db/fts/fts_util_test.cpp +++ /dev/null @@ -1,48 +0,0 @@ -// fts_util_test.cpp - -/** -* Copyright (C) 2012 10gen Inc. -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Affero General Public License, version 3, -* as published by the Free Software Foundation. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU Affero General Public License for more details. -* -* You should have received a copy of the GNU Affero General Public License -* along with this program. If not, see <http://www.gnu.org/licenses/>. -* -* As a special exception, the copyright holders give permission to link the -* code of portions of this program with the OpenSSL library under certain -* conditions as described in each individual source file and distribute -* linked combinations including the program with the OpenSSL library. You -* must comply with the GNU Affero General Public License in all respects for -* all of the code used other than as permitted herein. If you modify file(s) -* with this exception, you may extend this exception to your version of the -* file(s), but you are not obligated to do so. If you do not wish to do so, -* delete this exception statement from your version. If you delete this -* exception statement from all source files in the program, then also delete -* it in the license file. -*/ - - -#include "mongo/unittest/unittest.h" - -#include "mongo/db/fts/fts_util.h" - -namespace mongo { - namespace fts { - - TEST( BSONElementMap, Simple1 ) { - BSONElementMap<double> m; - - BSONObj x = BSON( "x" << 5 ); - m[x.firstElement()] = 5; - ASSERT_EQUALS( 5, m[x.firstElement()] ); - } - - } -} |