1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-03-17 10:21:11 +00:00

Avoid copy from vector to string

Read directly into a string.
This commit is contained in:
elsid 2021-05-03 21:32:38 +02:00
parent f4cfade14b
commit 3e4abb9f04
No known key found for this signature in database
GPG Key ID: B845CB9FEE18AB40

View File

@ -142,11 +142,9 @@ public:
///Read in a string of the given length
std::string getSizedString(size_t length)
{
std::vector<char> str(length + 1, 0);
std::string str(length, '\0');
inp->read(str.data(), length);
return str.data();
return str;
}
///Read in a string of the length specified in the file
std::string getSizedString()