Use range-based loops when possible.

This commit is contained in:
Jim Evins
2017-12-30 22:09:48 -05:00
parent 9a135f8971
commit ff003e5b17
8 changed files with 48 additions and 48 deletions
+4 -4
View File
@@ -43,9 +43,9 @@ namespace glabels
bool Base::isAscii( const std::string& data ) const
{
for ( unsigned int i = 0; i < data.size(); i++ )
for (char c : data)
{
if ( (data[i] & 0x80) != 0 )
if ( (c & 0x80) != 0 )
{
return false;
}
@@ -61,9 +61,9 @@ namespace glabels
{
unsigned int n = 0;
for ( unsigned int i = 0; i < data.size(); i++ )
for (char c : data)
{
if ( isdigit(data[i]) )
if ( isdigit(c) )
{
n++;
}