]> granicus.if.org Git - pdns/commitdiff
15% speedup in zone loading
authorbert hubert <bert.hubert@netherlabs.nl>
Thu, 11 Feb 2016 10:11:40 +0000 (11:11 +0100)
committerbert hubert <bert.hubert@netherlabs.nl>
Thu, 11 Feb 2016 10:11:40 +0000 (11:11 +0100)
pdns/dnsname.cc

index f2535a46cd165034897712f1474eecdc48ea7ea3..c2c9a710f25837ad0b7c83e5b8d9f8f455d7bb42 100644 (file)
@@ -298,6 +298,7 @@ size_t hash_value(DNSName const& d)
 string DNSName::escapeLabel(const std::string& label)
 {
   string ret;
+  ret.reserve(label.size()); // saves 15% on bulk .COM load
   for(uint8_t p : label) {
     if(p=='.')
       ret+="\\.";