]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_db: short circuit type_f if type is unchanged
authorEric Sandeen <sandeen@redhat.com>
Mon, 24 Aug 2020 16:47:47 +0000 (12:47 -0400)
committerEric Sandeen <sandeen@sandeen.net>
Mon, 24 Aug 2020 16:47:47 +0000 (12:47 -0400)
There's no reason to go through the type change code if the
type has not been changed.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
db/type.c

index 3cb1e868b6c6a823858957106b7f224618800210..572ac6d6d41725c31eba931bff93dfe1d51976f7 100644 (file)
--- a/db/type.c
+++ b/db/type.c
@@ -216,6 +216,8 @@ type_f(
                tt = findtyp(argv[1]);
                if (tt == NULL) {
                        dbprintf(_("no such type %s\n"), argv[1]);
+               } else if (iocur_top->typ == tt) {
+                       return 0;
                } else {
                        if (iocur_top->typ == NULL)
                                dbprintf(_("no current object\n"));