From 38d28e6253fedfc3638c3dce6de0ba485a85a39f Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Fri, 21 Sep 2018 15:06:53 +0200 Subject: [PATCH] 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 --- src/functions/functions.device | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) 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 -- 2.47.2