Simplified char buffer construction
This commit is contained in:
parent
cdd1fed777
commit
2121c50735
@ -82,8 +82,7 @@ string sc::file_get_contents(const string& path)
|
||||
file.seekg(0, ios::end);
|
||||
ios::pos_type file_len {file.tellg()};
|
||||
file.seekg(0);
|
||||
vector<char> buf;
|
||||
buf.resize(file_len);
|
||||
vector<char> buf(file_len);
|
||||
file.read(buf.data(), file_len);
|
||||
return {buf.data(), static_cast<string::size_type>(file_len)};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user