Small optimization of parameter attribute lookup.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44458 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan Sands 2007-11-30 18:20:58 +00:00
parent 757d243167
commit 6bb0ae4711

View File

@ -79,7 +79,7 @@ void Argument::setParent(Function *parent) {
uint16_t
ParamAttrsList::getParamAttrs(uint16_t Index) const {
unsigned limit = attrs.size();
for (unsigned i = 0; i < limit; ++i)
for (unsigned i = 0; i < limit && attrs[i].index <= Index; ++i)
if (attrs[i].index == Index)
return attrs[i].attrs;
return ParamAttr::None;