[libcamera-devel,1/3] test: camera: Remove redundant call of std::string::c_str()
diff mbox series

Message ID 20220829185849.1884517-2-marvin.schmidt1987@gmail.com
State Accepted
Commit 7354fb3b890bba37c81d70fc47f551d18be5c9ba
Headers show
Series
  • Remove redundant calls to std::string::c_str()
Related show

Commit Message

Marvin Schmidt Aug. 29, 2022, 6:58 p.m. UTC
libcamera::File::exists() takes a const reference to a std::string and
clang-tidy's readability-redundant-string-cstr check warns about it:

> ../test/camera/camera_reconfigure.cpp:182:21: warning: redundant call to 'c_str' [readability-redundant-string-cstr]
>                         if (File::exists(pname.c_str())) {
>                                          ^~~~~~~~~~~~~
>                                          pname

Signed-off-by: Marvin Schmidt <marvin.schmidt1987@gmail.com>
---
 test/camera/camera_reconfigure.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/test/camera/camera_reconfigure.cpp b/test/camera/camera_reconfigure.cpp
index f6076baa..d12e2413 100644
--- a/test/camera/camera_reconfigure.cpp
+++ b/test/camera/camera_reconfigure.cpp
@@ -179,7 +179,7 @@  private:
 				continue;
 
 			string pname("/proc/" + string(ptr->d_name) + "/comm");
-			if (File::exists(pname.c_str())) {
+			if (File::exists(pname)) {
 				ifstream pfile(pname.c_str());
 				string comm;
 				getline(pfile, comm);