mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-18 10:10:45 +08:00
perf: simplify for loops and lambdas, etc
This commit is contained in:
@@ -594,10 +594,8 @@ bool asst::Controller::screencap()
|
||||
return false;
|
||||
}
|
||||
size_t header_size = data.size() - std_size;
|
||||
bool is_all_zero = std::all_of(data.data() + header_size, data.data() + std_size,
|
||||
[](uchar uch) -> bool {
|
||||
return uch == 0;
|
||||
});
|
||||
bool is_all_zero =
|
||||
std::all_of(data.data() + header_size, data.data() + std_size, std::logical_not<bool>{});
|
||||
if (is_all_zero) {
|
||||
return false;
|
||||
}
|
||||
@@ -621,10 +619,8 @@ bool asst::Controller::screencap()
|
||||
return false;
|
||||
}
|
||||
size_t header_size = unzip_data.size() - std_size;
|
||||
bool is_all_zero = std::all_of(unzip_data.data() + header_size, unzip_data.data() + std_size,
|
||||
[](uchar uch) -> bool {
|
||||
return uch == 0;
|
||||
});
|
||||
bool is_all_zero =
|
||||
std::all_of(unzip_data.data() + header_size, unzip_data.data() + std_size, std::logical_not<bool>{});
|
||||
if (is_all_zero) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user