~victored/noise/grid-view-optimizations-2

« back to all changes in this revision

Viewing changes to plugins/Devices/AudioPlayers/AudioPlayerDevice.vala

  • Committer: Sergey "Shnatsel" Davidoff
  • Date: 2014-07-03 09:18:20 UTC
  • mfrom: (1625.1.1 noise)
  • Revision ID: shnatsel@gmail.com-20140703091820-2vasu5imxl5m999u
* Migrate the collection of files to import from Gee.LinkedList to Gee.TreeSet; this speeds up deduplication to log(n) complexity compared to current n^2, speeds up .contains() lookups to log(n) compared to current linear, and allows to remove some custom deduplication code. Fixes bug #1286944
* Abstract the troubled (bug #1336846) FileUtils.count_music_files () method to handle any Gee.Collection and not just Gee.LinkedList; this is a prerequisite to the above speedup. It breaks plugin API/ABI but we officially don't care about such things (bug #1336493).

Show diffs side-by-side

added added

removed removed

Lines of Context:
89
89
            int items = 0;
90
90
            foreach (var folder in music_folders) {
91
91
                var music_folder_file = GLib.File.new_for_uri (folder);
92
 
                items += FileUtils.count_music_files (music_folder_file, ref files);
 
92
                items += FileUtils.count_music_files (music_folder_file, files);
93
93
            }
94
94
 
95
95
            debug ("found %d items to import\n", items);