g_list_append() had to traverse entire list to find the end.
If list doesn't have to be sorted with specific order,
g_list_prepend() will be enough.
Change-Id: I10b9851a8576733d7100b4d2e8564fe8775aada7
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
if (__check_dpi(ss->dpi, dpi) != 0)
return;
- *list = g_list_append(*list, ss);
+ *list = g_list_prepend(*list, ss);
}
static void __find_appcontrol_splashscreen(gpointer data, gpointer user_data)
return;
}
- *list = g_list_append(*list, ss);
+ *list = g_list_prepend(*list, ss);
}
static GList *__find_splashscreens(GList *splashscreens)
ss = __find_default_splashscreen(splashscreens, "portrait");
if (ss)
- list = g_list_append(list, ss);
+ list = g_list_prepend(list, ss);
ss = __find_default_splashscreen(splashscreens, "landscape");
if (ss)
- list = g_list_append(list, ss);
+ list = g_list_prepend(list, ss);
return list;
}
val = NULL;
_save_column_str(stmt, 0, &val);
if (val)
- *category = g_list_append(*category, (gpointer)val);
+ *category = g_list_prepend(*category, (gpointer)val);
}
sqlite3_finalize(stmt);
ac->mime = strdup(token);
ac->visibility = strdup(visibility);
ac->id = strdup(id);
- *appcontrol = g_list_append(*appcontrol, ac);
+ *appcontrol = g_list_prepend(*appcontrol, ac);
} while ((token = strtok_r(NULL, ";", &ptr)));
free(dup);
idx = 0;
_save_column_str(stmt, idx++, &info->key);
_save_column_str(stmt, idx++, &info->value);
- *metadata = g_list_append(*metadata, info);
+ *metadata = g_list_prepend(*metadata, info);
}
sqlite3_finalize(stmt);
_save_column_str(stmt, idx++, &info->indicatordisplay);
_save_column_str(stmt, idx++, &info->operation);
_save_column_str(stmt, idx++, &info->color_depth);
- *splashscreens = g_list_append(*splashscreens, info);
+ *splashscreens = g_list_prepend(*splashscreens, info);
}
sqlite3_finalize(stmt);
return NULL;
if (convert_value & APP_BG_CATEGORY_USER_DISABLE_TRUE_VAL)
- category_list = g_list_append(category_list, strdup(APP_BG_CATEGORY_USER_DISABLE_TRUE_STR));
+ category_list = g_list_prepend(category_list, strdup(APP_BG_CATEGORY_USER_DISABLE_TRUE_STR));
else
- category_list = g_list_append(category_list, strdup(APP_BG_CATEGORY_USER_DISABLE_FALSE_STR));
+ category_list = g_list_prepend(category_list, strdup(APP_BG_CATEGORY_USER_DISABLE_FALSE_STR));
if (convert_value & APP_BG_CATEGORY_MEDIA_VAL)
- category_list = g_list_append(category_list, strdup(APP_BG_CATEGORY_MEDIA_STR));
+ category_list = g_list_prepend(category_list, strdup(APP_BG_CATEGORY_MEDIA_STR));
if (convert_value & APP_BG_CATEGORY_DOWNLOAD_VAL)
- category_list = g_list_append(category_list, strdup(APP_BG_CATEGORY_DOWNLOAD_STR));
+ category_list = g_list_prepend(category_list, strdup(APP_BG_CATEGORY_DOWNLOAD_STR));
if (convert_value & APP_BG_CATEGORY_BGNETWORK_VAL)
- category_list = g_list_append(category_list, strdup(APP_BG_CATEGORY_BGNETWORK_STR));
+ category_list = g_list_prepend(category_list, strdup(APP_BG_CATEGORY_BGNETWORK_STR));
if (convert_value & APP_BG_CATEGORY_LOCATION_VAL)
- category_list = g_list_append(category_list, strdup(APP_BG_CATEGORY_LOCATION_STR));
+ category_list = g_list_prepend(category_list, strdup(APP_BG_CATEGORY_LOCATION_STR));
if (convert_value & APP_BG_CATEGORY_SENSOR_VAL)
- category_list = g_list_append(category_list, strdup(APP_BG_CATEGORY_SENSOR_STR));
+ category_list = g_list_prepend(category_list, strdup(APP_BG_CATEGORY_SENSOR_STR));
if (convert_value & APP_BG_CATEGORY_IOTCOMM_VAL)
- category_list = g_list_append(category_list, strdup(APP_BG_CATEGORY_IOTCOMM_STR));
+ category_list = g_list_prepend(category_list, strdup(APP_BG_CATEGORY_IOTCOMM_STR));
if (convert_value & APP_BG_CATEGORY_SYSTEM_VAL)
- category_list = g_list_append(category_list, strdup(APP_BG_CATEGORY_SYSTEM));
+ category_list = g_list_prepend(category_list, strdup(APP_BG_CATEGORY_SYSTEM));
return category_list;
}
info->lang = strdup(locale);
info->text = record;
- *description = g_list_append(*description, info);
+ *description = g_list_prepend(*description, info);
return PMINFO_R_OK;
}
_save_column_str(stmt, 0, &plugin->appid);
_save_column_str(stmt, 1, &plugin->plugin_type);
_save_column_str(stmt, 2, &plugin->plugin_name);
- *plugins = g_list_append(*plugins,
+ *plugins = g_list_prepend(*plugins,
(gpointer)plugin);
}
}
_save_column_str(stmt, 0, &privilege->value);
_save_column_str(stmt, 1, &privilege->type);
- *privileges = g_list_append(*privileges,
+ *privileges = g_list_prepend(*privileges,
(gpointer)privilege);
}
_save_column_str(stmt, 0, &privilege->value);
_save_column_str(stmt, 1, &privilege->license);
_save_column_str(stmt, 2, &privilege->type);
- *privileges = g_list_append(*privileges,
+ *privileges = g_list_prepend(*privileges,
(gpointer)privilege);
}
_save_column_str(stmt, 0, &dependency->depends_on);
_save_column_str(stmt, 1, &dependency->type);
_save_column_str(stmt, 2, &dependency->required_version);
- *dependencies = g_list_append(*dependencies,
+ *dependencies = g_list_prepend(*dependencies,
(gpointer)dependency);
}
_save_column_str(stmt, idx++, &author->text);
_save_column_str(stmt, idx++, &author->email);
_save_column_str(stmt, idx++, &author->href);
- info->author = g_list_append(info->author, author);
+ info->author = g_list_prepend(info->author, author);
}
if (flag & PMINFO_PKGINFO_GET_LABEL) {
_save_column_str(stmt, 2, &req->type);
_save_column_str(stmt, 3, &req->version);
- *pkg_list = g_list_append(*pkg_list, req);
+ *pkg_list = g_list_prepend(*pkg_list, req);
g_queue_push_tail(*queue, strdup(req->from));
}
if (appid) {
plugin->appid = strdup(appid);
}
- plugin_list = g_list_append(plugin_list, plugin);
+ plugin_list = g_list_prepend(plugin_list, plugin);
}
for (tmp_list = plugin_list; tmp_list != NULL; tmp_list = tmp_list->next) {
}
info->text = value;
info->lang = strdup(locale);
- *icon = g_list_append(*icon, info);
+ *icon = g_list_prepend(*icon, info);
return PMINFO_R_OK;
}
}
info->text = value;
info->lang = strdup(locale);
- *label = g_list_append(*label, info);
+ *label = g_list_prepend(*label, info);
return PMINFO_R_OK;
}
info->uid = uid;
info->db_path = __get_dbpath(uid);
- user_info_list = g_list_append(user_info_list, info);
+ user_info_list = g_list_prepend(user_info_list, info);
}
closedir(dir);