mirror of
https://github.com/taglib/taglib.git
synced 2025-06-04 01:28:21 -04:00
Merge pull request #544 from TsudaKageyu/advance
Use std::advance rather than a loop and increment.
This commit is contained in:
commit
650b581f9e
@ -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…
x
Reference in New Issue
Block a user