]> granicus.if.org Git - nethack/commitdiff
redundant code warning line 400 src/apply.c
authornhmall <nhmall@nethack.org>
Thu, 18 Aug 2022 01:16:23 +0000 (21:16 -0400)
committernhmall <nhmall@nethack.org>
Thu, 18 Aug 2022 01:16:23 +0000 (21:16 -0400)
                if (odummy->otyp == SLIME_MOLD
400 ->                    && has_mcorpsenm(mtmp) && MCORPSENM(mtmp) != NON_PM)

The definition of has_mcorpsenm macro is:
include/mextra.h:#define has_mcorpsenm(mon) ((mon)->mextra && MCORPSENM(mon) != NON_PM)

Remove the redundant code.

src/apply.c

index ad7ea0dd67e18801b3338dd079f66438c2abe5f8..09da24177eb645cf77ef2e4fb120b57f3811c820 100644 (file)
@@ -396,8 +396,7 @@ use_stethoscope(struct obj *obj)
                 /* simple_typename() yields "fruit" for any named fruit;
                    we want the same thing '//' or ';' shows: "slime mold"
                    or "grape" or "slice of pizza" */
-                if (odummy->otyp == SLIME_MOLD
-                    && has_mcorpsenm(mtmp) && MCORPSENM(mtmp) != NON_PM) {
+                if (odummy->otyp == SLIME_MOLD && has_mcorpsenm(mtmp)) {
                     odummy->spe = MCORPSENM(mtmp);
                     what = simpleonames(odummy);
                 } else {