Code refactoring for using GList 88/218788/10 accepted/tizen/unified/20191227.142816 submit/tizen/20191226.093041
authorjiyong.min <jiyong.min@samsung.com>
Thu, 28 Nov 2019 06:10:50 +0000 (15:10 +0900)
committerhj kim <backto.kim@samsung.com>
Thu, 26 Dec 2019 09:24:12 +0000 (09:24 +0000)
commit422e5cee300309be9055a93d4f3037019505c6b0
treec602e1314a99be7d28fbb4417235c3da4384b9df
parent527307c77a36133da7112e46106ab140a24292ae
Code refactoring for using GList

 - The loop to find listener over the GList are replaced to 'g_list_find_custom()'.

 - The 'g_list_length()' is not fast because GList does not keep track of the number of items.
   To reduce the 'g_list_length()' call, using index for a loop over the list are replaced
   to using iterator.

   To visit all elements in the list, use a loop over the list:
   GList *l;
   for (l = list; l != NULL; l = l->next)
   {
      // do something with l->data
   }

   reference: https://developer.gnome.org/glib/stable/glib-Doubly-Linked-Lists.html

Change-Id: Ic916d5ef9157b3c7574631b975351507f860fcb5
src/media_controller_client.c
src/media_controller_ipc.c
src/media_controller_metadata.c
src/media_controller_playlist.c [changed mode: 0755->0644]
svc/media_controller_svc.c
test/server_test/media_controller_server_test.c