boost::array instead of std::vector in nodelist

This should provide a minor performance boost & memory reduction.
This commit is contained in:
Strahinja Val Markovic 2013-03-01 20:10:12 -08:00
parent dae3dcdd9e
commit c8a9d0590e
2 changed files with 2 additions and 5 deletions

View File

@ -39,8 +39,6 @@ int IndexForChar( char letter ) {
LetterNodeListMap::LetterNodeListMap() {
letters_.resize( kNumLetters );
for ( uint i = 0; i < letters_.size(); ++i ) {
letters_[ i ] = NULL;
}

View File

@ -18,9 +18,9 @@
#ifndef LETTERNODELISTMAP_H_BRK2UMC1
#define LETTERNODELISTMAP_H_BRK2UMC1
#include <vector>
#include <list>
#include <boost/utility.hpp>
#include <boost/array.hpp>
#define NUM_LETTERS 128
@ -47,8 +47,7 @@ public:
bool HasLetter( char letter ) const;
private:
std::vector< std::list< LetterNode * >* > letters_;
boost::array< std::list< LetterNode * >*, NUM_LETTERS > letters_;
};
} // namespace YouCompleteMe