summaryrefslogtreecommitdiffstats
path: root/wscript
diff options
context:
space:
mode:
authorJames Ross-Gowan <rossymiles@gmail.com>2016-08-19 23:13:54 +1000
committerJames Ross-Gowan <rossymiles@gmail.com>2016-08-20 00:07:32 +1000
commit68dc869d6aa8eb7004e2f86e9e4dcbf203ae6a8c (patch)
tree9598d7cdf47c3f7ba30d4c1b32106775018c733a /wscript
parente5f61c2bd5d15821e9d6f0967884156e210e74f4 (diff)
downloadmpv-68dc869d6aa8eb7004e2f86e9e4dcbf203ae6a8c.tar.bz2
mpv-68dc869d6aa8eb7004e2f86e9e4dcbf203ae6a8c.tar.xz
command: prevent O(n^2) behaviour for playlist property
When fetching the playlist property, playlist_entry_from_index would be called for each playlist entry, which traversed a linked list to get the entry corresponding to the specified index. This was very slow for large playlists. Since get_playlist_entry is called for each index in order, it can avoid a full traversal of the linked list by using the next pointer on the previously requested entry.
Diffstat (limited to 'wscript')
0 files changed, 0 insertions, 0 deletions