Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Declare local variables inside the if statement.
[simgrid.git] / src / mc / remote / RemoteProcess.cpp
index dda2716..3923fd8 100644 (file)
@@ -319,8 +319,7 @@ std::string RemoteProcess::read_string(RemotePtr<char> address) const
       continue;
     xbt_assert(c > 0, "Could not read string from remote process");
 
-    const void* p = memchr(res.data() + off, '\0', c);
-    if (p)
+    if (const void* p = memchr(res.data() + off, '\0', c))
       return std::string(res.data());
 
     off += c;