File tree Expand file tree Collapse file tree 1 file changed +1
-14
lines changed Expand file tree Collapse file tree 1 file changed +1
-14
lines changed Original file line number Diff line number Diff line change 44#include "hashmap.h"
55#include "libudev-list-internal.h"
66#include "list.h"
7- #include "sort-util.h"
87
98/**
109 * SECTION:libudev-list
@@ -136,10 +135,6 @@ struct udev_list *udev_list_free(struct udev_list *list) {
136135 return mfree (list );
137136}
138137
139- static int udev_list_entry_compare_func (struct udev_list_entry * const * a , struct udev_list_entry * const * b ) {
140- return strcmp ((* a )-> name , (* b )-> name );
141- }
142-
143138struct udev_list_entry * udev_list_get_entry (struct udev_list * list ) {
144139 if (!list )
145140 return NULL ;
@@ -156,18 +151,10 @@ struct udev_list_entry *udev_list_get_entry(struct udev_list *list) {
156151 LIST_PREPEND (entries , list -> entries , hashmap_first (list -> unique_entries ));
157152 else {
158153 _cleanup_free_ struct udev_list_entry * * buf = NULL ;
159- struct udev_list_entry * entry , * * p ;
160154
161- buf = new (struct udev_list_entry * , n );
162- if (!buf )
155+ if (hashmap_dump_sorted (list -> unique_entries , (void * * * ) & buf , /* ret_n = */ NULL ) < 0 )
163156 return NULL ;
164157
165- p = buf ;
166- HASHMAP_FOREACH (entry , list -> unique_entries )
167- * p ++ = entry ;
168-
169- typesafe_qsort (buf , n , udev_list_entry_compare_func );
170-
171158 for (size_t j = n ; j > 0 ; j -- )
172159 LIST_PREPEND (entries , list -> entries , buf [j - 1 ]);
173160 }
You can’t perform that action at this time.
0 commit comments