From a6b4b7fd277a7aa2450c97cd191264f14521c017 Mon Sep 17 00:00:00 2001 From: Strahinja Val Markovic Date: Thu, 6 Sep 2012 12:56:08 -0700 Subject: [PATCH] LetterHash -> LetterNodeListMap --- cpp/ycm/LetterNode.h | 5 ++--- cpp/ycm/{LetterHash.cpp => LetterNodeListMap.cpp} | 14 +++++++------- cpp/ycm/{LetterHash.h => LetterNodeListMap.h} | 12 ++++++------ cpp/ycm/tests/IndexForChar_test.cpp | 2 +- cpp/ycm/tests/IsUppercase_test.cpp | 2 +- 5 files changed, 17 insertions(+), 18 deletions(-) rename cpp/ycm/{LetterHash.cpp => LetterNodeListMap.cpp} (83%) rename cpp/ycm/{LetterHash.h => LetterNodeListMap.h} (84%) diff --git a/cpp/ycm/LetterNode.h b/cpp/ycm/LetterNode.h index 3091e489..733f74e3 100644 --- a/cpp/ycm/LetterNode.h +++ b/cpp/ycm/LetterNode.h @@ -18,7 +18,7 @@ #ifndef LETTERNODE_H_EIZ6JVWC #define LETTERNODE_H_EIZ6JVWC -#include "LetterHash.h" +#include "LetterNodeListMap.h" #include #include @@ -63,8 +63,7 @@ public: private: - // TODO: rename LetterHash to LetterNodeListHash or LetterNodeListDict/Map? - LetterHash letters_; + LetterNodeListMap letters_; std::vector< boost::shared_ptr< LetterNode > > letternode_per_text_index_; bool is_uppercase_; bool is_root_node_; diff --git a/cpp/ycm/LetterHash.cpp b/cpp/ycm/LetterNodeListMap.cpp similarity index 83% rename from cpp/ycm/LetterHash.cpp rename to cpp/ycm/LetterNodeListMap.cpp index 0d47b367..041de706 100644 --- a/cpp/ycm/LetterHash.cpp +++ b/cpp/ycm/LetterNodeListMap.cpp @@ -15,7 +15,7 @@ // You should have received a copy of the GNU General Public License // along with YouCompleteMe. If not, see . -#include "LetterHash.h" +#include "LetterNodeListMap.h" #include "standard.h" namespace YouCompleteMe @@ -41,7 +41,7 @@ int IndexForChar( char letter ) } -LetterHash::LetterHash() +LetterNodeListMap::LetterNodeListMap() { letters_.resize( kNumLetters ); @@ -52,7 +52,7 @@ LetterHash::LetterHash() } -LetterHash::~LetterHash() +LetterNodeListMap::~LetterNodeListMap() { for ( uint i = 0; i < letters_.size(); ++i ) { @@ -61,7 +61,7 @@ LetterHash::~LetterHash() } -bool LetterHash::HasLetter( char letter ) +bool LetterNodeListMap::HasLetter( char letter ) { int letter_index = IndexForChar( letter ); std::list< LetterNode* > *list = letters_[ letter_index ]; @@ -69,7 +69,7 @@ bool LetterHash::HasLetter( char letter ) } -std::list< LetterNode* >& LetterHash::operator[] ( char letter ) +std::list< LetterNode* >& LetterNodeListMap::operator[] ( char letter ) { int letter_index = IndexForChar( letter ); std::list< LetterNode* > *list = letters_[ letter_index ]; @@ -82,13 +82,13 @@ std::list< LetterNode* >& LetterHash::operator[] ( char letter ) } -std::list< LetterNode* >* LetterHash::ListPointerAt( char letter ) +std::list< LetterNode* >* LetterNodeListMap::ListPointerAt( char letter ) { return letters_[ IndexForChar( letter ) ]; } -bool LetterHash::HasLetter( char letter ) const +bool LetterNodeListMap::HasLetter( char letter ) const { return letters_[ IndexForChar( letter ) ] != NULL; } diff --git a/cpp/ycm/LetterHash.h b/cpp/ycm/LetterNodeListMap.h similarity index 84% rename from cpp/ycm/LetterHash.h rename to cpp/ycm/LetterNodeListMap.h index 4c08939f..02ceeabc 100644 --- a/cpp/ycm/LetterHash.h +++ b/cpp/ycm/LetterNodeListMap.h @@ -15,8 +15,8 @@ // You should have received a copy of the GNU General Public License // along with YouCompleteMe. If not, see . -#ifndef LETTERHASH_H_BRK2UMC1 -#define LETTERHASH_H_BRK2UMC1 +#ifndef LETTERNODELISTMAP_H_BRK2UMC1 +#define LETTERNODELISTMAP_H_BRK2UMC1 #include #include @@ -34,11 +34,11 @@ extern const int kNumLetters; int IndexForChar( char letter ); bool IsUppercase( char letter ); -class LetterHash : boost::noncopyable +class LetterNodeListMap : boost::noncopyable { public: - LetterHash(); - ~LetterHash(); + LetterNodeListMap(); + ~LetterNodeListMap(); bool HasLetter( char letter ); @@ -55,5 +55,5 @@ private: } // namespace YouCompleteMe -#endif /* end of include guard: LETTERHASH_H_BRK2UMC1 */ +#endif /* end of include guard: LETTERNODELISTMAP_H_BRK2UMC1 */ diff --git a/cpp/ycm/tests/IndexForChar_test.cpp b/cpp/ycm/tests/IndexForChar_test.cpp index 1d283b00..21d81a38 100644 --- a/cpp/ycm/tests/IndexForChar_test.cpp +++ b/cpp/ycm/tests/IndexForChar_test.cpp @@ -16,7 +16,7 @@ // along with YouCompleteMe. If not, see . #include -#include "LetterHash.h" +#include "LetterNodeListMap.h" namespace YouCompleteMe { diff --git a/cpp/ycm/tests/IsUppercase_test.cpp b/cpp/ycm/tests/IsUppercase_test.cpp index c7c614b5..053fdcbe 100644 --- a/cpp/ycm/tests/IsUppercase_test.cpp +++ b/cpp/ycm/tests/IsUppercase_test.cpp @@ -16,7 +16,7 @@ // along with YouCompleteMe. If not, see . #include -#include "LetterHash.h" +#include "LetterNodeListMap.h" namespace YouCompleteMe {