From c4a73d030977603fc5d844123644363426ae166b Mon Sep 17 00:00:00 2001 From: Andoni Morales Alastruey Date: Thu, 9 Dec 2010 22:54:07 +0100 Subject: [PATCH 2/2] Replace legacy index() with strchr() and avoid calculating the index twice --- gst/fsrtpconference/fs-rtp-codec-specific.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gst/fsrtpconference/fs-rtp-codec-specific.c b/gst/fsrtpconference/fs-rtp-codec-specific.c index e3827e5..0e58ada 100644 --- a/gst/fsrtpconference/fs-rtp-codec-specific.c +++ b/gst/fsrtpconference/fs-rtp-codec-specific.c @@ -740,10 +740,12 @@ parse_events (const gchar *events) for (i = 0; ranges_strv[i]; i++) { struct event_range *er = g_slice_new (struct event_range); + gchar *p = NULL; er->first = atoi (ranges_strv[i]); - if (index (ranges_strv[i], '-')) - er->last = atoi (index (ranges_strv[i], '-') + 1); + p = strchr (ranges_strv[i], '-'); + if (p) + er->last = atoi (p + 1); else er->last = er->first; -- 1.7.0.2.msysgit.0