[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [elpa] externals/emms e9fa4c095d: * emms.el: reverse the order playe
From: |
Stefan Monnier |
Subject: |
Re: [elpa] externals/emms e9fa4c095d: * emms.el: reverse the order players are collected |
Date: |
Tue, 06 Sep 2022 21:50:40 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
> --- a/emms.el
> +++ b/emms.el
> @@ -1511,7 +1511,7 @@ If the track can be played by more than one player, call
> (mapc
> #'(lambda (player)
> (when (funcall (emms-player-get player 'playablep) track)
> - (push player players)))
> + (setq players (append players `(,player)))))
> emms-player-list)
> (if (< 1 (length players))
> (emms-players-preference track players)
This changes the code's complexity from O(N) to O(N²) in the number of
players. Maybe it's not a very big deal, but the standard way to avoid
this is to use `push` inside the loop followed by `nreverse` at the of
the loop.
Stefan
- Re: [elpa] externals/emms e9fa4c095d: * emms.el: reverse the order players are collected,
Stefan Monnier <=