lordgamez commented on code in PR #1354:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1354#discussion_r923548689
##########
libminifi/test/unit/BackTraceTests.cpp:
##########
@@ -41,17 +41,13 @@ class WorkerNumberExecutions : public
utils::AfterExecute<int> {
}
bool isFinished(const int &result) override {
- if (result > 0 && ++runs < tasks) {
- return false;
- } else {
- return true;
- }
+ return !(result > 0 && ++runs < tasks);
Review Comment:
I suppose it doesn't really make readability worse, so I updated it in
1e565fb3ed786137ba5410991273a85cf5102a6a
##########
libminifi/test/unit/FileUtilsTests.cpp:
##########
@@ -80,17 +80,17 @@ TEST_CASE("TestFileUtils::get_child_path",
"[TestGetChildPath]") {
REQUIRE("bar\\" == FileUtils::get_child_path("C:\\foo\\bar\\"));
REQUIRE("foo" == FileUtils::get_child_path("C:\\foo"));
REQUIRE("foo\\" == FileUtils::get_child_path("C:\\foo\\"));
- REQUIRE("" == FileUtils::get_child_path("C:\\"));
- REQUIRE("" == FileUtils::get_child_path("C:\\\\"));
+ REQUIRE(FileUtils::get_child_path("C:\\").empty());
+ REQUIRE(FileUtils::get_child_path("C:\\\\").empty());
#else
REQUIRE("bar" == FileUtils::get_child_path("foo/bar"));
REQUIRE("bar/" == FileUtils::get_child_path("foo/bar/"));
REQUIRE("bar" == FileUtils::get_child_path("/foo/bar"));
REQUIRE("bar/" == FileUtils::get_child_path("/foo/bar/"));
REQUIRE("foo" == FileUtils::get_child_path("/foo"));
REQUIRE("foo/" == FileUtils::get_child_path("/foo/"));
- REQUIRE("" == FileUtils::get_child_path("/"));
- REQUIRE("" == FileUtils::get_child_path("//"));
+ REQUIRE(FileUtils::get_child_path("/").empty());
+ REQUIRE(FileUtils::get_child_path("//").empty());
Review Comment:
I agree, updated in 1e565fb3ed786137ba5410991273a85cf5102a6a
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]