1
0
mirror of git://erdgeist.org/opentracker synced 2025-01-27 07:06:45 +00:00

Some premature optimization lead to always only 8bytes of ot_peers being copied

This commit is contained in:
erdgeist 2009-01-15 22:10:54 +00:00
parent 02b3abbab6
commit 4ced0484ab
2 changed files with 2 additions and 2 deletions

View File

@ -33,7 +33,7 @@ static ssize_t clean_single_bucket( ot_peer *peers, size_t peer_count, time_t ti
while( peers < last_peer )
if( ( timediff = timedout + OT_PEERTIME( peers ) ) < OT_PEER_TIMEOUT ) {
OT_PEERTIME( peers ) = timediff;
*(uint64_t*)(insert_point++) = *(uint64_t*)(peers++);
memcpy( insert_point++, peers++, sizeof(ot_peer));
} else
if( OT_PEERFLAG( peers++ ) & PEER_FLAG_SEEDING )
(*removed_seeders)++;

View File

@ -244,7 +244,7 @@ void vector_redistribute_buckets( ot_peerlist * peer_list ) {
bucket_dest->space *= OT_VECTOR_GROW_RATIO;
}
peers_new = (ot_peer*)bucket_dest->data;
*(uint64_t*)(peers_new + bucket_dest->size++) = *(uint64_t*)(peers_old++);
memcpy(peers_new + bucket_dest->size++, peers_old++, sizeof(ot_peer));
}
}