[wpiutil] Change StringExtras split() to template (#7636)

It now calls back a function for each part rather than creating a SmallVector.
This commit is contained in:
Peter Johnson
2025-01-05 20:53:43 -08:00
committed by GitHub
parent 0f6693594c
commit 03d9e96877
17 changed files with 161 additions and 171 deletions

View File

@@ -1015,7 +1015,8 @@ void NetworkTablesModel::RebuildTreeImpl(std::vector<TreeNode>* tree,
continue;
}
parts.clear();
wpi::split(entry->info.name, parts, '/', -1, false);
wpi::split(entry->info.name, '/', -1, false,
[&](auto part) { parts.emplace_back(part); });
// ignore a raw "/" key
if (parts.empty()) {