Blame SOURCES/xfsprogs-5.8.0-xfs_db-short-circuit-type_f-if-type-is-unchanged.patch

48cf7c
From 7b4a7b3f6bce91be45b54fc68e169cb756dc8c74 Mon Sep 17 00:00:00 2001
48cf7c
From: Eric Sandeen <sandeen@redhat.com>
48cf7c
Date: Mon, 24 Aug 2020 12:47:47 -0400
48cf7c
Subject: [PATCH] xfs_db: short circuit type_f if type is unchanged
48cf7c
48cf7c
There's no reason to go through the type change code if the
48cf7c
type has not been changed.
48cf7c
48cf7c
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
48cf7c
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
48cf7c
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
48cf7c
---
48cf7c
 db/type.c | 2 ++
48cf7c
 1 file changed, 2 insertions(+)
48cf7c
48cf7c
diff --git a/db/type.c b/db/type.c
48cf7c
index 3cb1e868..572ac6d6 100644
48cf7c
--- a/db/type.c
48cf7c
+++ b/db/type.c
48cf7c
@@ -216,6 +216,8 @@ type_f(
48cf7c
 		tt = findtyp(argv[1]);
48cf7c
 		if (tt == NULL) {
48cf7c
 			dbprintf(_("no such type %s\n"), argv[1]);
48cf7c
+		} else if (iocur_top->typ == tt) {
48cf7c
+			return 0;
48cf7c
 		} else {
48cf7c
 			if (iocur_top->typ == NULL)
48cf7c
 				dbprintf(_("no current object\n"));
48cf7c
-- 
48cf7c
2.29.2
48cf7c