mirror of
https://github.com/SFML/CSFML.git
synced 2026-10-24 21:53:37 +02:00
Use ranged-for loops
This commit is contained in:
1 parent
7676dfd95e
commit
3401cade6e
3 files changed
+9
-9
No files matched your search
@@ -90,9 +90,9 @@ const char** sfSoundRecorder_getAvailableDevices(size_t* count)
|
||||
|
||||
if (cstringDevices.empty() && !stringDevices.empty())
|
||||
{
|
||||
for (std::vector<std::string>::const_iterator it = stringDevices.begin(); it != stringDevices.end(); ++it)
|
||||
for (const auto& stringDevice : stringDevices)
|
||||
{
|
||||
cstringDevices.push_back(it->c_str());
|
||||
cstringDevices.push_back(stringDevice.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -81,8 +81,8 @@ struct sfFtpListingResponse
|
||||
|
||||
~sfFtpListingResponse()
|
||||
{
|
||||
for (std::vector<const char*>::iterator it = Filenames.begin(); it != Filenames.end(); ++it)
|
||||
delete[] *it;
|
||||
for (const auto& filename : Filenames)
|
||||
delete[] filename;
|
||||
}
|
||||
|
||||
sf::Ftp::ListingResponse This;
|
||||
|
||||
@@ -51,13 +51,13 @@ const sfVideoMode* sfVideoMode_getFullscreenModes(size_t* count)
|
||||
// Populate the array on first call
|
||||
if (modes.empty())
|
||||
{
|
||||
const std::vector<sf::VideoMode>& SFMLModes = sf::VideoMode::getFullscreenModes();
|
||||
for (std::vector<sf::VideoMode>::const_iterator it = SFMLModes.begin(); it != SFMLModes.end(); ++it)
|
||||
const std::vector<sf::VideoMode>& sfmlModes = sf::VideoMode::getFullscreenModes();
|
||||
for (const auto& sfmlMode : sfmlModes)
|
||||
{
|
||||
sfVideoMode mode;
|
||||
mode.width = it->width;
|
||||
mode.height = it->height;
|
||||
mode.bitsPerPixel = it->bitsPerPixel;
|
||||
mode.width = sfmlMode.width;
|
||||
mode.height = sfmlMode.height;
|
||||
mode.bitsPerPixel = sfmlMode.bitsPerPixel;
|
||||
modes.push_back(mode);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user