1
0

fix: replace find with contains in constraint builder

- remove useless old files.
This commit is contained in:
2025-08-13 08:51:53 +08:00
parent 8fcfa180b4
commit f65eff6edf
7 changed files with 5 additions and 333 deletions

View File

@ -35,14 +35,10 @@ namespace yycc::constraint::builder {
T default_entry = il.begin()[default_index];
std::set<T> entries(il);
// TODO: modify it as `contain` once we finish patch namespace.
auto fn_check = [entries](const T& val) -> bool { return entries.find(val) != entries.end(); };
auto fn_check = [entries](const T& val) -> bool { return entries.contains(val); };
auto fn_clamp = [entries, default_entry](const T& val) -> T {
if (entries.find(val) != entries.end()) {
return val;
} else {
return default_entry;
}
if (entries.contains(val)) return val;
else return default_entry;
};
return Constraint<T>(std::move(fn_check), fn_clamp);
}