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() {
|
LetterNodeListMap::LetterNodeListMap() {
|
||||||
letters_.resize( kNumLetters );
|
|
||||||
|
|
||||||
for ( uint i = 0; i < letters_.size(); ++i ) {
|
for ( uint i = 0; i < letters_.size(); ++i ) {
|
||||||
letters_[ i ] = NULL;
|
letters_[ i ] = NULL;
|
||||||
}
|
}
|
||||||
|
@ -18,9 +18,9 @@
|
|||||||
#ifndef LETTERNODELISTMAP_H_BRK2UMC1
|
#ifndef LETTERNODELISTMAP_H_BRK2UMC1
|
||||||
#define LETTERNODELISTMAP_H_BRK2UMC1
|
#define LETTERNODELISTMAP_H_BRK2UMC1
|
||||||
|
|
||||||
#include <vector>
|
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <boost/utility.hpp>
|
#include <boost/utility.hpp>
|
||||||
|
#include <boost/array.hpp>
|
||||||
|
|
||||||
#define NUM_LETTERS 128
|
#define NUM_LETTERS 128
|
||||||
|
|
||||||
@ -47,8 +47,7 @@ public:
|
|||||||
bool HasLetter( char letter ) const;
|
bool HasLetter( char letter ) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
boost::array< std::list< LetterNode * >*, NUM_LETTERS > letters_;
|
||||||
std::vector< std::list< LetterNode * >* > letters_;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace YouCompleteMe
|
} // namespace YouCompleteMe
|
||||||
|
Loading…
x
Reference in New Issue
Block a user