Merge pull request #538 from gogglesmm/optimize-mid-to-uint

bytevector.mid(pos,4).toUInt() => bytevector.toUInt(pos)
This commit is contained in:
Lukáš Lalinský 2015-05-15 20:06:24 -07:00
commit db2dfa9515
2 changed files with 5 additions and 5 deletions

View File

@ -221,13 +221,13 @@ void ChapterFrame::parseFields(const ByteVector &data)
int pos = 0, embPos = 0;
d->elementID = readStringField(data, String::Latin1, &pos).data(String::Latin1);
d->elementID.append(char(0));
d->startTime = data.mid(pos, 4).toUInt(true);
d->startTime = data.toUInt(pos, true);
pos += 4;
d->endTime = data.mid(pos, 4).toUInt(true);
d->endTime = data.toUInt(pos, true);
pos += 4;
d->startOffset = data.mid(pos, 4).toUInt(true);
d->startOffset = data.toUInt(pos, true);
pos += 4;
d->endOffset = data.mid(pos, 4).toUInt(true);
d->endOffset = data.toUInt(pos, true);
pos += 4;
size -= pos;

View File

@ -193,7 +193,7 @@ void SynchronizedLyricsFrame::parseFields(const ByteVector &data)
if(text.isNull() || pos + 4 > end)
return;
uint time = data.mid(pos, 4).toUInt(true);
uint time = data.toUInt(pos, true);
pos += 4;
d->synchedText.append(SynchedText(time, text));