Browse Source

[trac550] cleanup: defer variable definition until it's really used.

JINMEI Tatuya 14 years ago
parent
commit
1d018cd8a6
1 changed files with 3 additions and 4 deletions
  1. 3 4
      src/lib/datasrc/memory_datasrc.cc

+ 3 - 4
src/lib/datasrc/memory_datasrc.cc

@@ -93,14 +93,13 @@ struct MemoryZone::MemoryZoneImpl {
              l > origin_labels;
              l > origin_labels;
              --l, wname = wname.split(1)) {
              --l, wname = wname.split(1)) {
             if (wname.isWildcard()) {
             if (wname.isWildcard()) {
-                DomainNode* node;
-                DomainTree::Result result;
-
                 // Ensure a separate level exists for the wildcard name.
                 // Ensure a separate level exists for the wildcard name.
                 // Note: for 'name' itself we do this later anyway, but the
                 // Note: for 'name' itself we do this later anyway, but the
                 // overhead should be marginal because wildcard names should
                 // overhead should be marginal because wildcard names should
                 // be rare.
                 // be rare.
-                result = domains.insert(wname.split(1), &node);
+                DomainNode* node;
+                DomainTree::Result result(domains.insert(wname.split(1),
+                                                         &node));
                 assert(result == DomainTree::SUCCESS ||
                 assert(result == DomainTree::SUCCESS ||
                        result == DomainTree::ALREADYEXISTS);
                        result == DomainTree::ALREADYEXISTS);