From: Arvin Schnell Date: Wed, 18 Feb 2015 11:28:36 +0000 (+0100) Subject: - use C++11 lambda X-Git-Tag: v0.2.6~1^2~3 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=43ab2ae50d81f8110efbb9e1b5b98421bd2ec720;p=thirdparty%2Fsnapper.git - use C++11 lambda --- diff --git a/snapper/Comparison.cc b/snapper/Comparison.cc index ffb0defd..bca9c2e2 100644 --- a/snapper/Comparison.cc +++ b/snapper/Comparison.cc @@ -101,17 +101,6 @@ namespace snapper } - struct Comparison::AppendHelper - { - AppendHelper(const FilePaths* file_paths, Files& files) - : file_paths(file_paths), files(files) {} - void operator()(const string& name, unsigned int status) - { files.push_back(File(file_paths, name, status)); } - const FilePaths* file_paths; - Files& files; - }; - - void Comparison::mount() const { @@ -137,13 +126,9 @@ namespace snapper { y2mil("num1:" << getSnapshot1()->getNum() << " num2:" << getSnapshot2()->getNum()); -#if 1 - cmpdirs_cb_t cb = AppendHelper(&file_paths, files); -#else - cmpdirs_cb_t cb = [&file_paths, &files](const string& name, unsigned int status) { + cmpdirs_cb_t cb = [this](const string& name, unsigned int status) { files.push_back(File(&file_paths, name, status)); }; -#endif mount();