Changed a for() loop to a memcpy when searching by powers
authorAri Johnson <ari@cobramush.org>
Thu, 5 Apr 2007 14:32:28 +0000 (14:32 +0000)
committerAri Johnson <ari@theari.com>
Thu, 24 Mar 2011 15:58:45 +0000 (15:58 +0000)
(cherry picked from commit 1c3c4022b8d86110a51af99e073f39c14ca8d102)

src/wiz.c

index ac4fdc8a6020e111211e637dfd7f6476fe18fc5d..79861faffcb4fc7201b8880a32878a3ec9a8fcc1 100644 (file)
--- a/src/wiz.c
+++ b/src/wiz.c
@@ -1976,7 +1976,6 @@ fill_search_spec(dbref player, const char *owner, int nargs, const char **args,
       spec->type = TYPE_PLAYER;
     } else if (string_prefix("powers", class)) {
       div_pbits tmpbits;
-      int i;
       /* Handle the checking later.  */
       if (!restriction || !*restriction) {
        notify(player, T("You must give a list of power names."));
@@ -1984,8 +1983,7 @@ fill_search_spec(dbref player, const char *owner, int nargs, const char **args,
       }
       spec->search_powers = 1;
       tmpbits = string_to_dpbits(restriction);
-      for (i = 0; i < DP_BYTES; i++)
-        spec->powers[i] = tmpbits[i];
+      memcpy(spec->powers, tmpbits, DP_BYTES);
       mush_free(tmpbits, "POWER_SPOT");
     } else if (string_prefix("flags", class)) {
       /* Handle the checking later.  */