mirror of
https://github.com/taglib/taglib.git
synced 2025-05-27 21:20:26 -04:00
Use std::advance rather than a loop and increment.
This commit is contained in:
parent
c2570fe115
commit
6e40361c0e
@ -266,9 +266,7 @@ template <class T>
|
||||
T &List<T>::operator[](uint i)
|
||||
{
|
||||
Iterator it = d->list.begin();
|
||||
|
||||
for(uint j = 0; j < i; j++)
|
||||
++it;
|
||||
std::advance(it, i);
|
||||
|
||||
return *it;
|
||||
}
|
||||
@ -277,9 +275,7 @@ template <class T>
|
||||
const T &List<T>::operator[](uint i) const
|
||||
{
|
||||
ConstIterator it = d->list.begin();
|
||||
|
||||
for(uint j = 0; j < i; j++)
|
||||
++it;
|
||||
std::advance(it, i);
|
||||
|
||||
return *it;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user