mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-31 02:14:09 +03:00
Simplify std::vector initializations
Resizing the vector does the same thing that the loops did, it changes the size for the vector and initializes it with default-constructed elements (or 0 or its equivalent for POD types). Where a specific value is needed, it is set with the second parameter of resize().
This commit is contained in:
@@ -11,15 +11,10 @@ scriptclass::scriptclass()
|
||||
//Start SDL
|
||||
|
||||
//Init
|
||||
for (int init = 0; init < 500; init++)
|
||||
{
|
||||
commands.push_back(std::string());
|
||||
}
|
||||
for (int init = 0; init < 40; init++)
|
||||
{
|
||||
words.push_back(std::string());
|
||||
txt.push_back(std::string());
|
||||
}
|
||||
commands.resize(500);
|
||||
words.resize(40);
|
||||
txt.resize(40);
|
||||
|
||||
position = 0;
|
||||
scriptlength = 0;
|
||||
scriptdelay = 0;
|
||||
|
||||
Reference in New Issue
Block a user