diff options
| author | Jonas Ask | 2009-10-27 03:02:25 +0000 |
|---|---|---|
| committer | Jonas Ask | 2009-10-27 03:02:25 +0000 |
| commit | 19992f118ac8cc2e8e3e3e91b7c6c44bb262b069 (patch) | |
| tree | 78db2850866624381ad46e157e526baf9087d3f9 /CreatureConfiguration.cpp | |
| parent | 859aeb104988ebd437390b550ea855fa9667360e (diff) | |
| download | stonesense-19992f118ac8cc2e8e3e3e91b7c6c44bb262b069.tar.gz stonesense-19992f118ac8cc2e8e3e3e91b7c6c44bb262b069.tar.bz2 stonesense-19992f118ac8cc2e8e3e3e91b7c6c44bb262b069.tar.xz | |
Optimizing code.
Changed most loops to precache vector size.
Diffstat (limited to 'CreatureConfiguration.cpp')
| -rw-r--r-- | CreatureConfiguration.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/CreatureConfiguration.cpp b/CreatureConfiguration.cpp index 291ac8a..641b3c4 100644 --- a/CreatureConfiguration.cpp +++ b/CreatureConfiguration.cpp @@ -30,11 +30,12 @@ void DumpCreatureNamesToDisk(){ }
void TranslateCreatureNames(){
+ uint32_t numCreatures = (uint32_t)v_creatureNames.size();
//for each config, find it's integer ID
for(uint32_t i=0; i < creatureTypes.size(); i++){
char* ptr = creatureTypes[i].gameIDstr;
uint32_t j;
- for(j=0; j < v_creatureNames.size(); j++){
+ for(j=0; j < numCreatures; j++){
if( strcmp( ptr, v_creatureNames[j].id) == 0){
//assign ID
creatureTypes[i].gameID = j;
|
