Removed an extra vector allocation from the previous card loading optimization.
This commit is contained in:
@@ -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;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user