From: Eric Sandeen Date: Mon, 24 Aug 2020 16:47:47 +0000 (-0400) Subject: xfs_db: short circuit type_f if type is unchanged X-Git-Tag: v5.8.0-rc1~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7b4a7b3f6bce91be45b54fc68e169cb756dc8c74;p=thirdparty%2Fxfsprogs-dev.git xfs_db: short circuit type_f if type is unchanged There's no reason to go through the type change code if the type has not been changed. Signed-off-by: Eric Sandeen Reviewed-by: Darrick J. Wong Signed-off-by: Eric Sandeen --- diff --git a/db/type.c b/db/type.c index 3cb1e868b..572ac6d6d 100644 --- 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"));