Modernize to C++11: Use for-range loop.

This commit is contained in:
Haojian Wu 2016-07-10 13:32:40 +02:00
parent 3bdeac98bf
commit 55b3f1936f
17 changed files with 66 additions and 71 deletions

View file

@ -63,10 +63,10 @@ float GetScaleFactorFromPath(const base::FilePath& path) {
// We don't try to convert string to float here because it is very very
// expensive.
for (unsigned i = 0; i < node::arraysize(kScaleFactorPairs); ++i) {
if (base::EndsWith(filename, kScaleFactorPairs[i].name,
for (auto& kScaleFactorPair : kScaleFactorPairs) {
if (base::EndsWith(filename, kScaleFactorPair.name,
base::CompareCase::INSENSITIVE_ASCII))
return kScaleFactorPairs[i].scale;
return kScaleFactorPair.scale;
}
return 1.0f;