]> git.ipfire.org Git - people/ms/network.git/commitdiff
Speed up device_list() by removing the alphabetical sort
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 21 Sep 2018 13:06:53 +0000 (15:06 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 21 Sep 2018 13:06:53 +0000 (15:06 +0200)
We are now returning all devices, then all PHYs, then all
serial devices.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/functions/functions.device

index 28eb3c53a6a814af203794746e1020bee8402065..8b31434d12fef4ac8cded765986d7b4b53fcc337 100644 (file)
@@ -30,8 +30,6 @@ declare -A DEVICE_LINK_SPEEDS=(
 )
 
 device_list() {
-       local devices
-
        # Add all interfaces
        local device
        for device in $(list_directory ${SYS_CLASS_NET}); do
@@ -40,14 +38,11 @@ device_list() {
                fi
        done
 
-       # Add all PHYs
-       list_append devices $(phy_list)
-
-       # Add all serial devices
-       list_append devices $(serial_list)
+       # List all PHYs
+       phy_list
 
-       # Return a sorted result
-       list_sort ${devices}
+       # List all serial devices
+       serial_list
 }
 
 # Check if the device exists