summaryrefslogtreecommitdiff
path: root/src/cstore/cstore.cpp
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2026-10-05 18:28:22 +0100
committerGitHub <noreply@github.com>2026-10-05 18:28:22 +0100
commit2bd92c6164ddfd8ac6f86ceee3d7cd37307f564f (patch)
tree423e3d8ea0ee5cdd62673026b67159a1d5bc4519 /src/cstore/cstore.cpp
parentad4048e997639bda41a57bc998d83dd3f623460e (diff)
parent6860ce4912c9d9d2f641f4532106ee6a3412523d (diff)
downloadvyatta-cfg-2bd92c6164ddfd8ac6f86ceee3d7cd37307f564f.tar.gz
vyatta-cfg-2bd92c6164ddfd8ac6f86ceee3d7cd37307f564f.zip
Merge pull request #156 from alexk37/cstore-add-tag-list-only-with-limit
cstore: T9376: list tag values only when there is a tag limit to check
Diffstat (limited to 'src/cstore/cstore.cpp')
-rw-r--r--src/cstore/cstore.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/cstore/cstore.cpp b/src/cstore/cstore.cpp
index bc6aa4d..c4a3579 100644
--- a/src/cstore/cstore.cpp
+++ b/src/cstore/cstore.cpp
@@ -2925,8 +2925,13 @@ Cstore::add_tag(unsigned int tlimit)
string t;
pop_cfg_path(t);
vector<string> cnodes;
- // get child nodes, excluding deactivated ones.
- get_all_child_node_names(cnodes, false, false);
+ /* get child nodes, excluding deactivated ones, only when there is a limit
+ * to check: listing them for every added value made adding n values to a
+ * tag node O(n^2) (loading a 10,000-entry prefix-list took 50 minutes).
+ */
+ if (tlimit > 0) {
+ get_all_child_node_names(cnodes, false, false);
+ }
bool ret = false;
do {
if (tlimit > 0 && tlimit <= cnodes.size()) {