flvdemux: minor micro-optimisation
authorTim-Philipp Müller <tim.muller@collabora.co.uk>
Fri, 19 Feb 2010 00:46:40 +0000 (00:46 +0000)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Fri, 19 Feb 2010 12:13:08 +0000 (12:13 +0000)
We know these values don't change during the loop, but the compiler
doesn't and has to re-check them for every iteration.

gst/flv/gstflvparse.c

index 935af21ba1765373d5dcf9e29cff91679954a9b3..86c638f4cd71b14c8f5f92853c93ab7f5ba6787e 100644 (file)
@@ -422,8 +422,11 @@ gst_flv_parse_tag_script (GstFLVDemux * demux, GstBuffer * buffer)
 
     if (demux->index && demux->times && demux->filepositions
         && !demux->random_access) {
+      guint num;
+
       /* If an index was found and we're in push mode, insert associations */
-      for (i = 0; i < MIN (demux->times->len, demux->filepositions->len); i++) {
+      num = MIN (demux->times->len, demux->filepositions->len);
+      for (i = 0; i < num; i++) {
         GstIndexAssociation associations[2];
         guint64 time, fileposition;