summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-02-06 22:42:30 +0200
committerKieran Bingham <kieran.bingham@ideasonboard.com>2020-02-13 16:47:56 +0000
commit52774fff56f8315c3f6a55940fa7099a8982eab8 (patch)
treee4917f7e3ab847b96c16d6415abc8937cdab7ad6
parent53057c2a3e6a794c350b48aa9a554b0af6229a59 (diff)
libcamera: ipa_manager: Use utils::split()
Replace the custom string splitting implementation with utils::split(). Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> [Kieran: Re-fit to master branch] Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rw-r--r--src/libcamera/ipa_manager.cpp21
1 files changed, 6 insertions, 15 deletions
diff --git a/src/libcamera/ipa_manager.cpp b/src/libcamera/ipa_manager.cpp
index 92adc6c4..4ffbdd71 100644
--- a/src/libcamera/ipa_manager.cpp
+++ b/src/libcamera/ipa_manager.cpp
@@ -110,22 +110,13 @@ IPAManager::IPAManager()
return;
}
- const char *paths = modulePaths;
- while (1) {
- const char *delim = strchrnul(paths, ':');
- size_t count = delim - paths;
-
- if (count) {
- std::string path(paths, count);
- ret = addDir(path.c_str());
- if (ret > 0)
- ipaCount += ret;
- }
-
- if (*delim == '\0')
- break;
+ for (const auto &dir : utils::split(modulePaths, ":")) {
+ if (dir.empty())
+ continue;
- paths += count + 1;
+ int ret = addDir(dir.c_str());
+ if (ret > 0)
+ ipaCount += ret;
}
if (!ipaCount)