[Swan-dev] replacing a loop in unbound_resolve() with memcpy?

D. Hugh Redelmeier hugh at mimosa.com
Fri Mar 26 14:07:38 UTC 2021


Code:
	for (unsigned b = 0; b < afi->ip_size; b++) {
		bytes.byte[b] = result->data[0][b];
	}

Could this loop not be replaced by a memcpy?

	memcpy(bytes.byte, result->data[0], afi->ip_size);

Is there some reason that this is a bad idea?


More information about the Swan-dev mailing list