[vlc-commits] stats: use TAB_CLEAN, simplify

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


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

stats: use TAB_CLEAN, simplify

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

 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..ee61546fb2 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 < p_c->i_samples; 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