All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: grub-devel@gnu.org
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Subject: [RFC PATCH v3 5/5] Cleanup: grub-mkconfig_lib: remove unused version comparison functions
Date: Fri, 20 May 2022 10:37:41 -0400	[thread overview]
Message-ID: <20220520143741.217690-6-mathieu.desnoyers@efficios.com> (raw)
In-Reply-To: <20220520143741.217690-1-mathieu.desnoyers@efficios.com>

There are no users left of version_find_latest(), version_test_gt(), and
version_test_numeric(). Remove those unused helper functions. Using
those helper functions is what caused the quadratic sorting performance
issues in the first place, so removing them is a net win.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
---
 util/grub-mkconfig_lib.in | 51 ---------------------------------------
 1 file changed, 51 deletions(-)

diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in
index fc14afdb3..de1bb5310 100644
--- a/util/grub-mkconfig_lib.in
+++ b/util/grub-mkconfig_lib.in
@@ -218,57 +218,6 @@ version_sort ()
    esac
 }
 
-version_test_numeric ()
-{
-  version_test_numeric_a="$1"
-  version_test_numeric_cmp="$2"
-  version_test_numeric_b="$3"
-  if [ "$version_test_numeric_a" = "$version_test_numeric_b" ] ; then
-    case "$version_test_numeric_cmp" in
-      ge|eq|le) return 0 ;;
-      gt|lt) return 1 ;;
-    esac
-  fi
-  if [ "$version_test_numeric_cmp" = "lt" ] ; then
-    version_test_numeric_c="$version_test_numeric_a"
-    version_test_numeric_a="$version_test_numeric_b"
-    version_test_numeric_b="$version_test_numeric_c"
-  fi
-  if (echo "$version_test_numeric_a" ; echo "$version_test_numeric_b") | version_sort | head -n 1 | grep -qx "$version_test_numeric_b" ; then
-    return 0
-  else
-    return 1
-  fi
-}
-
-version_test_gt ()
-{
-  version_test_gt_a="`echo "$1" | sed -e "s/[^-]*-//"`"
-  version_test_gt_b="`echo "$2" | sed -e "s/[^-]*-//"`"
-  version_test_gt_cmp=gt
-  if [ "x$version_test_gt_b" = "x" ] ; then
-    return 0
-  fi
-  case "$version_test_gt_a:$version_test_gt_b" in
-    *.old:*.old) ;;
-    *.old:*) version_test_gt_a="`echo "$version_test_gt_a" | sed -e 's/\.old$//'`" ; version_test_gt_cmp=gt ;;
-    *:*.old) version_test_gt_b="`echo "$version_test_gt_b" | sed -e 's/\.old$//'`" ; version_test_gt_cmp=ge ;;
-  esac
-  version_test_numeric "$version_test_gt_a" "$version_test_gt_cmp" "$version_test_gt_b"
-  return "$?"
-}
-
-version_find_latest ()
-{
-  version_find_latest_a=""
-  for i in "$@" ; do
-    if version_test_gt "$i" "$version_find_latest_a" ; then
-      version_find_latest_a="$i"
-    fi
-  done
-  echo "$version_find_latest_a"
-}
-
 # One layer of quotation is eaten by "" and the second by sed; so this turns
 # ' into \'.
 grub_quote () {
-- 
2.30.2



  parent reply	other threads:[~2022-05-20 14:38 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-20 14:37 [RFC PATCH v3 0/5] grub-mkconfig: Fix quadratic algorithm for sorting menu items Mathieu Desnoyers
2022-05-20 14:37 ` [RFC PATCH v3 1/5] grub-mkconfig linux: " Mathieu Desnoyers
2022-05-26 15:13   ` Daniel Kiper
2022-05-26 18:34     ` Mathieu Desnoyers
2022-06-08 18:10       ` Daniel Kiper
2022-05-20 14:37 ` [RFC PATCH v3 2/5] grub-mkconfig linux_xen: " Mathieu Desnoyers
2022-05-20 14:37 ` [RFC PATCH v3 3/5] grub-mkconfig hurd: " Mathieu Desnoyers
2022-05-20 14:37 ` [RFC PATCH v3 4/5] grub-mkconfig kfreebsd: " Mathieu Desnoyers
2022-05-20 14:37 ` Mathieu Desnoyers [this message]
2022-05-26 21:07   ` [RFC PATCH v3 5/5] Cleanup: grub-mkconfig_lib: remove unused version comparison functions Robbie Harwood
2022-05-27  6:07     ` Michael Chang
2022-05-27 14:56       ` Robbie Harwood
2022-05-27 21:45         ` Daniel Kiper
2022-05-30 13:31         ` Mathieu Desnoyers
2022-05-20 16:08 ` [RFC PATCH v3 0/5] grub-mkconfig: Fix quadratic algorithm for sorting menu items Mathieu Desnoyers
2022-05-26 15:24   ` Daniel Kiper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220520143741.217690-6-mathieu.desnoyers@efficios.com \
    --to=mathieu.desnoyers@efficios.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.