optimize view_initialize for NODE_HASH views
This closes
@@ -286,6 +286,15 @@ static void view_initialize(qd_iterator_t *iter)
if (iter->view == ITER_VIEW_ALL)
return;
+ //
+ // ITER_VIEW_NODE_HASH has no scheme or leading slash - see iterator.h
+ // Do not walk the entire iterator trying to find one.
+ //
+ if (iter->view == ITER_VIEW_NODE_HASH) {
+ parse_node_view(iter);
+ return;
+ }
+
//
// Advance to the node-id.
//
@@ -367,11 +376,6 @@ static void view_initialize(qd_iterator_t *iter)
adjust_address_with_space(iter);
return;
}
-
- if (iter->view == ITER_VIEW_NODE_HASH) {
- parse_node_view(iter);
- return;
- }
}
