Unnecessary memory allocation removed in extractor
This commit is contained in:
parent
b44e36e7ba
commit
6996b24c44
@ -453,10 +453,9 @@ int main (int argc, char *argv[]) {
|
|||||||
cout << "ok" << endl;
|
cout << "ok" << endl;
|
||||||
time = get_timestamp();
|
time = get_timestamp();
|
||||||
cout << "[extractor] writing street name index ... " << flush;
|
cout << "[extractor] writing street name index ... " << flush;
|
||||||
vector<unsigned> * nameIndex = new vector<unsigned>(externalMemory.nameVector.size()+1, 0);
|
|
||||||
outputFileName.append(".names");
|
outputFileName.append(".names");
|
||||||
ofstream nameOutFile(outputFileName.c_str(), ios::binary);
|
ofstream nameOutFile(outputFileName.c_str(), ios::binary);
|
||||||
unsigned sizeOfNameIndex = nameIndex->size();
|
unsigned sizeOfNameIndex = externalMemory.nameVector.size();
|
||||||
nameOutFile.write((char *)&(sizeOfNameIndex), sizeof(unsigned));
|
nameOutFile.write((char *)&(sizeOfNameIndex), sizeof(unsigned));
|
||||||
|
|
||||||
BOOST_FOREACH(string str, externalMemory.nameVector) {
|
BOOST_FOREACH(string str, externalMemory.nameVector) {
|
||||||
@ -466,7 +465,6 @@ int main (int argc, char *argv[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
nameOutFile.close();
|
nameOutFile.close();
|
||||||
delete nameIndex;
|
|
||||||
cout << "ok, after " << get_timestamp() - time << "s" << endl;
|
cout << "ok, after " << get_timestamp() - time << "s" << endl;
|
||||||
|
|
||||||
// time = get_timestamp();
|
// time = get_timestamp();
|
||||||
|
Loading…
Reference in New Issue
Block a user