Browse Source

[1430] (unrelated cleanup) avoid calling getLabelCount() multiple times
unnecessarily.

JINMEI Tatuya 13 years ago
parent
commit
4acc56d228
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/lib/datasrc/database.cc

+ 2 - 1
src/lib/datasrc/database.cc

@@ -585,7 +585,8 @@ DatabaseClient::Finder::findWildcardMatch(
     WantedTypes final_types(FINAL_TYPES());
     final_types.insert(type);
 
-    for (size_t i = 1; i <= (name.getLabelCount() - dresult.last_known); ++i) {
+    const size_t remove_labels = name.getLabelCount() - dresult.last_known;
+    for (size_t i = 1; i <= remove_labels; ++i) {
 
         // Strip off the left-more label(s) in the name and replace with a "*".
         const Name superdomain(name.split(i));