]> granicus.if.org Git - taglib/commitdiff
replace use of bytevector.mid(pos,4).toUInt() with more optimized bytevector.toUInt...
authorSander Jansen <s.jansen@gmail.com>
Sat, 16 May 2015 02:25:44 +0000 (21:25 -0500)
committerSander Jansen <s.jansen@gmail.com>
Sat, 16 May 2015 02:25:44 +0000 (21:25 -0500)
taglib/mpeg/id3v2/frames/chapterframe.cpp
taglib/mpeg/id3v2/frames/synchronizedlyricsframe.cpp

index 667abc538add0c74d028401d9146356ec27c0c3a..bd3160e2a0cbfe6a3325b9fcc65275ba65b5c8ea 100644 (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;
 
index 878af9bd8c00094932cceffd286dc3c6f3d5d098..966c255a7d433f9c95f4b3823d157dccba6a7cf9 100644 (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));