From: Michael Tremer Date: Fri, 21 Sep 2018 13:06:53 +0000 (+0200) Subject: Speed up device_list() by removing the alphabetical sort X-Git-Tag: 010~41 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=38d28e6253fedfc3638c3dce6de0ba485a85a39f;p=network.git Speed up device_list() by removing the alphabetical sort We are now returning all devices, then all PHYs, then all serial devices. Signed-off-by: Michael Tremer --- diff --git a/src/functions/functions.device b/src/functions/functions.device index 28eb3c53..8b31434d 100644 --- a/src/functions/functions.device +++ b/src/functions/functions.device @@ -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