addMatching and insertFromParent functions from FocusableList now avoid copying m_parent->clientList() and use a const reference instead.

This commit is contained in:
Mario J. Rugiero 2014-12-20 00:53:53 -03:00 committed by Mathias Gumz
parent 63f89cb433
commit bf607341da

View file

@ -164,7 +164,7 @@ void FocusableList::checkUpdate(Focusable &win) {
// returns whether or not the window was moved
bool FocusableList::insertFromParent(Focusable &win) {
const Focusables list = m_parent->clientList();
const Focusables &list = m_parent->clientList();
Focusables::const_iterator p_it = list.begin(), p_it_end = list.end();
Focusables::iterator our_it = m_list.begin(), our_it_end = m_list.end();
// walk through our list looking for corresponding entries in
@ -189,7 +189,7 @@ void FocusableList::addMatching() {
if (!m_parent)
return;
const Focusables list = m_parent->clientList();
const Focusables &list = m_parent->clientList();
Focusables::const_iterator it = list.begin(), it_end = list.end();
for (; it != it_end; ++it) {
if (m_pat->match(**it)) {