summaryrefslogtreecommitdiff
path: root/node/Path.hpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2017-12-15 11:03:20 -0800
committerAdam Ierymenko <adam.ierymenko@gmail.com>2017-12-15 11:03:20 -0800
commit060870462606f82d3a9b0fe6aca87f8a5de8705e (patch)
tree2001ea775c3a8b65c756d64fff88c664c609feb3 /node/Path.hpp
parentcb8e7b4d5e3cb4c5b79ccb9f74c161182222daca (diff)
downloadinfinitytier-060870462606f82d3a9b0fe6aca87f8a5de8705e.tar.gz
infinitytier-060870462606f82d3a9b0fe6aca87f8a5de8705e.zip
Some micro-optimizations, including a memcpy that is faster than Linux for most distro/compiler versions.
Diffstat (limited to 'node/Path.hpp')
-rw-r--r--node/Path.hpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/node/Path.hpp b/node/Path.hpp
index ab52ced6..008b05c5 100644
--- a/node/Path.hpp
+++ b/node/Path.hpp
@@ -73,10 +73,10 @@ public:
_k[1] = (uint64_t)reinterpret_cast<const struct sockaddr_in *>(&r)->sin_port;
_k[2] = (uint64_t)l;
} else if (r.ss_family == AF_INET6) {
- memcpy(_k,reinterpret_cast<const struct sockaddr_in6 *>(&r)->sin6_addr.s6_addr,16);
+ ZT_FAST_MEMCPY(_k,reinterpret_cast<const struct sockaddr_in6 *>(&r)->sin6_addr.s6_addr,16);
_k[2] = ((uint64_t)reinterpret_cast<const struct sockaddr_in6 *>(&r)->sin6_port << 32) ^ (uint64_t)l;
} else {
- memcpy(_k,&r,std::min(sizeof(_k),sizeof(InetAddress)));
+ ZT_FAST_MEMCPY(_k,&r,std::min(sizeof(_k),sizeof(InetAddress)));
_k[2] += (uint64_t)l;
}
}