]> granicus.if.org Git - transmission/commitdiff
Don't use memmove() for simple assignment
authorMukund Sivaraman <muks@mukund.org>
Fri, 22 Aug 2008 16:34:16 +0000 (16:34 +0000)
committerMukund Sivaraman <muks@mukund.org>
Fri, 22 Aug 2008 16:34:16 +0000 (16:34 +0000)
libtransmission/peer-mgr.c

index 2eff99468d4acc39009abae7b906e7d38dae7557..f4649dbabe06924a5d98e8ae66aa6a62a8db317f 100644 (file)
@@ -720,7 +720,7 @@ refillPulse( void * vtorrent )
             {
                 case TR_ADDREQ_FULL:
                 case TR_ADDREQ_CLIENT_CHOKED:
-                    memmove( peers+j, peers + --peerCount, sizeof *peers );
+                    peers[j] = peers[--peerCount];
                     break;
                 case TR_ADDREQ_MISSING:
                 case TR_ADDREQ_DUPLICATE:
@@ -743,7 +743,7 @@ refillPulse( void * vtorrent )
             switch( val )
             {
                 case TR_ADDREQ_FULL:
-                    memmove( webseeds+j, webseeds + --webseedCount, sizeof *webseeds );
+                    webseeds[j] = webseeds[--webseedCount];
                     break;
                 case TR_ADDREQ_OK:
                     tr_bitfieldAdd( t->requestedPieces, piece );