ng_address_hook() microoptimization. Use local variables as they should be.

It helps compiller to avoid some extra memory accesses.
This commit is contained in:
Alexander Motin 2008-04-19 05:30:49 +00:00
parent a447fa875d
commit a04e98468d

View File

@ -3420,10 +3420,10 @@ ng_address_hook(node_p here, item_p item, hook_p hook, ng_ID_t retaddr)
* that the peer is still connected (even if invalid,) we know
* that the peer node is present, though maybe invalid.
*/
if ((hook == NULL)
|| NG_HOOK_NOT_VALID(hook)
|| NG_HOOK_NOT_VALID(NG_HOOK_PEER(hook))
|| NG_NODE_NOT_VALID(NG_PEER_NODE(hook))) {
if ((hook == NULL) ||
NG_HOOK_NOT_VALID(hook) ||
NG_HOOK_NOT_VALID(peer = NG_HOOK_PEER(hook)) ||
NG_NODE_NOT_VALID(peernode = NG_PEER_NODE(hook))) {
NG_FREE_ITEM(item);
TRAP_ERROR();
return (ENETDOWN);
@ -3432,11 +3432,9 @@ ng_address_hook(node_p here, item_p item, hook_p hook, ng_ID_t retaddr)
/*
* Transfer our interest to the other (peer) end.
*/
peer = NG_HOOK_PEER(hook);
NG_HOOK_REF(peer);
NGI_SET_HOOK(item, peer);
peernode = NG_PEER_NODE(hook);
NG_NODE_REF(peernode);
NGI_SET_HOOK(item, peer);
NGI_SET_NODE(item, peernode);
SET_RETADDR(item, here, retaddr);
return (0);