store ipaddresses in folly::IPAddress
authorMarc Celani <marccelani@fb.com>
Thu, 7 Aug 2014 20:24:05 +0000 (13:24 -0700)
committerSara Golemon <sgolemon@fb.com>
Thu, 14 Aug 2014 18:49:04 +0000 (11:49 -0700)
Summary: Save space and avoid extra mallocs

Test Plan: fbconfig -r smc/zeus; fbmake runtests

Reviewed By: henryf@fb.com

Subscribers: zeus-diffs@

FB internal diff: D1476688

Tasks: 4832974

folly/IPAddress.h

index e147c10d7bc599970e9401f70ee975f90edfea38..6446836f47050f62e6c2e7305e135e5e4671f862 100644 (file)
@@ -255,7 +255,7 @@ class IPAddress : boost::totally_ordered<IPAddress> {
   bool empty() const { return (family_ == AF_UNSPEC); }
 
   // @return true if address is initialized
-  explicit operator bool() { return !empty(); }
+  explicit operator bool() const { return !empty(); }
 
   // @return true if this is an IPAddressV4 instance
   bool isV4() const { return (family_ == AF_INET); }