forked from OSchip/llvm-project
[llvm-objcopy] Simplify find(X,Y) != X.end() with is_contained()
llvm-svn: 340241
This commit is contained in:
parent
1d432ae284
commit
0e49ef9540
|
@ -505,7 +505,7 @@ static void handleArgs(const CopyConfig &Config, Object &Obj,
|
|||
// Removes:
|
||||
if (!Config.ToRemove.empty()) {
|
||||
RemovePred = [&Config](const SectionBase &Sec) {
|
||||
return find(Config.ToRemove, Sec.Name) != Config.ToRemove.end();
|
||||
return is_contained(Config.ToRemove, Sec.Name);
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -573,7 +573,7 @@ static void handleArgs(const CopyConfig &Config, Object &Obj,
|
|||
if (!Config.OnlyKeep.empty()) {
|
||||
RemovePred = [&Config, RemovePred, &Obj](const SectionBase &Sec) {
|
||||
// Explicitly keep these sections regardless of previous removes.
|
||||
if (find(Config.OnlyKeep, Sec.Name) != Config.OnlyKeep.end())
|
||||
if (is_contained(Config.OnlyKeep, Sec.Name))
|
||||
return false;
|
||||
|
||||
// Allow all implicit removes.
|
||||
|
@ -595,7 +595,7 @@ static void handleArgs(const CopyConfig &Config, Object &Obj,
|
|||
if (!Config.Keep.empty()) {
|
||||
RemovePred = [Config, RemovePred](const SectionBase &Sec) {
|
||||
// Explicitly keep these sections regardless of previous removes.
|
||||
if (find(Config.Keep, Sec.Name) != Config.Keep.end())
|
||||
if (is_contained(Config.Keep, Sec.Name))
|
||||
return false;
|
||||
// Otherwise defer to RemovePred.
|
||||
return RemovePred(Sec);
|
||||
|
|
Loading…
Reference in New Issue