lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] ip6_addr_copy() ?


From: Leon Woestenberg
Subject: [lwip-devel] ip6_addr_copy() ?
Date: Sun, 12 Jun 2011 01:17:05 +0200

Hello,

/** Copy IPv6 address - faster than ip6_addr_set: no NULL check */
#define ip6_addr_copy(dest, src) do{(dest).addr[0] = (src).addr[0]; \
                                    (dest).addr[1] = (src).addr[1]; \
                                    (dest).addr[2] = (src).addr[2]; \
                                    (dest).addr[3] = (src).addr[3];}while(0)

As all members of the structure are copied, why not use this instead? :

dest = src;

That let's the compiler do the optimization and is much more readable.

Or did I overlook something?

Regards,
-- 
Leon



reply via email to

[Prev in Thread] Current Thread [Next in Thread]