mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-16 01:40:46 +08:00
chore.优化调试日志和调试宏
This commit is contained in:
@@ -202,9 +202,7 @@ size_t asst::InfrastProductionTask::opers_detect()
|
||||
[&cur_oper](const infrast::Oper& oper) -> bool {
|
||||
// 有可能是同一个干员,比一下hash
|
||||
int dist = utils::hamming(cur_oper.face_hash, oper.face_hash);
|
||||
#ifdef LOG_TRACE
|
||||
Log.trace("opers_detect hash dist |", dist);
|
||||
#endif
|
||||
Log.debug("opers_detect hash dist |", dist);
|
||||
return dist < m_face_hash_thres;
|
||||
});
|
||||
// 如果两个的hash距离过小,则认为是同一个干员,不进行插入
|
||||
@@ -370,9 +368,7 @@ bool asst::InfrastProductionTask::optimal_calc()
|
||||
if (!opt.possible_hashs.empty()) {
|
||||
for (const auto& [key, hash] : opt.possible_hashs) {
|
||||
int dist = utils::hamming(find_iter->name_hash, hash);
|
||||
#ifdef LOG_TRACE
|
||||
Log.trace("optimal_calc | name hash dist", dist, hash, find_iter->name_hash);
|
||||
#endif
|
||||
Log.debug("optimal_calc | name hash dist", dist, hash, find_iter->name_hash);
|
||||
if (dist < m_name_hash_thres) {
|
||||
hash_matched = true;
|
||||
break;
|
||||
@@ -498,9 +494,7 @@ bool asst::InfrastProductionTask::opers_choose()
|
||||
// 既要技能相同,也要hash相同,双重校验
|
||||
for (const auto& [_, hash] : opt_iter->possible_hashs) {
|
||||
int dist = utils::hamming(lhs.name_hash, hash);
|
||||
#ifdef LOG_TRACE
|
||||
Log.trace("opers_choose | name hash dist", dist);
|
||||
#endif
|
||||
Log.debug("opers_choose | name hash dist", dist);
|
||||
if (dist < m_name_hash_thres) {
|
||||
return true;
|
||||
}
|
||||
@@ -529,9 +523,7 @@ bool asst::InfrastProductionTask::opers_choose()
|
||||
m_all_available_opers.cbegin(), m_all_available_opers.cend(),
|
||||
[&](const infrast::Oper& lhs) -> bool {
|
||||
int dist = utils::hamming(lhs.face_hash, find_iter->face_hash);
|
||||
#ifdef LOG_TRACE
|
||||
Log.trace("opers_choose | face hash dist", dist);
|
||||
#endif
|
||||
Log.debug("opers_choose | face hash dist", dist);
|
||||
if (dist < m_face_hash_thres) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user