boost::array instead of std::vector in nodelist
This should provide a minor performance boost & memory reduction.
This commit is contained in:
parent
dae3dcdd9e
commit
c8a9d0590e
@ -39,8 +39,6 @@ int IndexForChar( char letter ) {
|
||||
|
||||
|
||||
LetterNodeListMap::LetterNodeListMap() {
|
||||
letters_.resize( kNumLetters );
|
||||
|
||||
for ( uint i = 0; i < letters_.size(); ++i ) {
|
||||
letters_[ i ] = NULL;
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user