-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DONE] Improve sort & menu order #1003
[DONE] Improve sort & menu order #1003
Conversation
…o AymericJak/improve_title_sort
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello, j'ai juste regardé le code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok pour moi niveau code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok pour moi. Juste une question pour mieux comprendre un changement ;)
@@ -201,7 +202,7 @@ def sort_videos_list(videos_list, sort_field, sort_direction=""): | |||
|
|||
Sorted by specific column name and ascending or descending direction | |||
""" | |||
if sort_field and sort_field in [ | |||
if sort_field and sort_field in { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pourquoi un dict plutot qu'une liste ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pour le parcours d'éléments, il est préférable d'utiliser un dictionnaire en python.
En python les dictionnaires sont implémenté avec une table de hachage.
Donc pour accéder à un élément, le temps est constant.
Pour une liste de taille n, la complexité est de O(n) --> on doit parcourir chaque éléments de celle-ci.
Alors que pour un dictionnaire, la complexité est de O(1).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merci pour l'info, c'est bon à savoir !! :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oui très bonne remarque !
* Improve video sort * Improve playlist sort * Fix titles * Reorganize menu buttons * Fix playlist test case * Improve playlist page tests * Add tests for playlists and flake8
* Improve video sort * Improve playlist sort * Fix titles * Reorganize menu buttons * Fix playlist test case * Improve playlist page tests * Add tests for playlists and flake8
* Improve video sort * Improve playlist sort * Fix titles * Reorganize menu buttons * Fix playlist test case * Improve playlist page tests * Add tests for playlists and flake8
Tri des vidéos & amélioration du menu
Issue concernée : #950