From 7ff7679a7690e939792ac84fc95938814f21985d Mon Sep 17 00:00:00 2001 From: nhmall Date: Mon, 27 Jan 2025 10:12:10 -0500 Subject: [PATCH] remove a redundant check for NULL mksobj is declared to have a NONNULL return: extern struct obj *mksobj(int, boolean, boolean) NONNULL; Remove an unnecessary if block. --- src/artifact.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/artifact.c b/src/artifact.c index b95bce4b8..506d50ea1 100644 --- a/src/artifact.c +++ b/src/artifact.c @@ -246,12 +246,10 @@ mk_artifact( * relevant */ struct obj *artiobj = mksobj((int) a->otyp, TRUE, FALSE); - if (artiobj) { - /* nonnull value of 'otmp' is unexpected. Cope. */ - if (otmp) /* just in case; avoid orphaning */ - dispose_of_orig_obj(otmp); - otmp = artiobj; - } + /* nonnull value of 'otmp' is unexpected. Cope. */ + if (otmp) /* just in case; avoid orphaning */ + dispose_of_orig_obj(otmp); + otmp = artiobj; } /* * otmp should be nonnull at this point: