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.
This commit is contained in:
nhmall
2025-01-27 10:12:10 -05:00
parent b6eda14368
commit 7ff7679a76
-2
View File
@@ -246,13 +246,11 @@ mk_artifact(
* relevant */ * relevant */
struct obj *artiobj = mksobj((int) a->otyp, TRUE, FALSE); struct obj *artiobj = mksobj((int) a->otyp, TRUE, FALSE);
if (artiobj) {
/* nonnull value of 'otmp' is unexpected. Cope. */ /* nonnull value of 'otmp' is unexpected. Cope. */
if (otmp) /* just in case; avoid orphaning */ if (otmp) /* just in case; avoid orphaning */
dispose_of_orig_obj(otmp); dispose_of_orig_obj(otmp);
otmp = artiobj; otmp = artiobj;
} }
}
/* /*
* otmp should be nonnull at this point: * otmp should be nonnull at this point:
* either the passed argument (if !by_align == A_NONE), or * either the passed argument (if !by_align == A_NONE), or