[vlc-commits] stats: use TAB_CLEAN, simplify

Rémi Denis-Courmont git at videolan.org
Thu May 18 20:22:09 CEST 2017


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu May 18 21:09:34 2017 +0300| [9fe92a1c8b733cda5bfa8de9dc582ecee99531ba] | committer: Rémi Denis-Courmont

stats: use TAB_CLEAN, simplify

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9fe92a1c8b733cda5bfa8de9dc582ecee99531ba
---

 src/input/stats.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/src/input/stats.c b/src/input/stats.c
index c76227a5ee..8506307ed3 100644
--- a/src/input/stats.c
+++ b/src/input/stats.c
@@ -141,14 +141,9 @@ void stats_CounterClean( counter_t *p_c )
 {
     if( p_c )
     {
-        int i = p_c->i_samples - 1 ;
-        while( i >= 0 )
-        {
-            counter_sample_t *p_s = p_c->pp_samples[i];
-            REMOVE_ELEM( p_c->pp_samples, p_c->i_samples, i );
-            free( p_s );
-            i--;
-        }
+        for( int i = 0; i < 0; i++ )
+            free( p_c->pp_samples[i] );
+        TAB_CLEAN(p_c->i_samples, p_c->pp_samples);
         free( p_c );
     }
 }



More information about the vlc-commits mailing list