Kaydet (Commit) 7aba9dcf authored tarafından Eike Rathke's avatar Eike Rathke

a vector is unnecessary here, tdf#79983 follow-up

Only the first case-insensitive match needs to be remembered.

Change-Id: Ifac666760878f769bc04d567db9284eedaa40a65
üst ef6ddb36
......@@ -274,7 +274,7 @@ ScUserList::ScUserList(const ScUserList& r) :
const ScUserListData* ScUserList::GetData(const OUString& rSubStr) const
{
std::vector<DataType::const_iterator> matchData;
const ScUserListData* pFirstCaseInsensitive = nullptr;
DataType::const_iterator itr = maData.begin(), itrEnd = maData.end();
sal_uInt16 nIndex;
bool bMatchCase = false;
......@@ -285,15 +285,12 @@ const ScUserListData* ScUserList::GetData(const OUString& rSubStr) const
{
if (bMatchCase)
return &(*itr);
matchData.push_back(itr);
if (!pFirstCaseInsensitive)
pFirstCaseInsensitive = &(*itr);
}
}
if (matchData.empty())
{
return NULL;
}
return &(**matchData.begin());
return pFirstCaseInsensitive;
}
const ScUserListData& ScUserList::operator[](size_t nIndex) const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment