Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private int sort_apps (App a, App b) {
- if (a.popularity > b.popularity)
- return 1;
- else if (a.popularity == b.popularity)
- return 0;
- else
- return -1;
- }
- public SList<App> get_sorted_apps () {
- var sorted_apps = new SList<App> ();
- foreach (ArrayList<App> category in apps.values) {
- foreach (App app in category) {
- sorted_apps.append (app);
- }
- }
- sorted_apps.sort_with_data ((CompareDataFunc<App>) sort_apps);
- return sorted_apps;
- }
Add Comment
Please, Sign In to add comment