Removed an extra vector allocation from the previous card loading optimization.

This commit is contained in:
wrenczes@gmail.com
2010-10-06 08:53:05 +00:00
parent 88ac1dd9a6
commit 1e7f2507f0
+4 -5
View File
@@ -264,11 +264,10 @@ int MTGAllCards::load(const char * config_file, const char * set_name,int autolo
streampos fileSize = setFile.tellg(); streampos fileSize = setFile.tellg();
setFile.seekg(0, ios::beg); setFile.seekg(0, ios::beg);
std::vector<char> textVector; std::string contents;
textVector.resize((std::vector<char>::size_type) fileSize); contents.resize((std::string::size_type)fileSize);
setFile.read(&textVector[0], fileSize); setFile.read(&contents[0], fileSize);
std::stringstream stream(contents);
std::stringstream stream(std::string(textVector.begin(), textVector.end()));
string s; string s;