[devel] [PATCH for apt v2 10/21] Improve member variable initialization
Aleksei Nikiforov
darktemplar на altlinux.org
Чт Дек 12 12:57:19 MSK 2019
Found via cppcheck:
(performance) Variable 'program' is assigned in constructor body.
Consider performing initialization in initialization list.
---
apt/methods/rsync.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/apt/methods/rsync.cc b/apt/methods/rsync.cc
index 64c9231..2b318fd 100644
--- a/apt/methods/rsync.cc
+++ b/apt/methods/rsync.cc
@@ -125,8 +125,8 @@ bool RsyncMethod::RsyncConn::initProxy()
RsyncMethod::RsyncConnExec::RsyncConnExec(URI u, const string &_proxy, const string &prog)
: RsyncConn(u,_proxy), ChildPid(-1), ChildFd(-1)
+ , program(prog.empty() ? RSYNC_PROGRAM : prog)
{
- program = prog.empty() ? RSYNC_PROGRAM : prog;
}
RsyncMethod::RsyncConnExec::~RsyncConnExec()
--
2.24.1
Подробная информация о списке рассылки Devel