What is the purpose of this function?
#16
Updated per your suggestions. Thank you very much.

Code:
bool CFileItemList::UpdateItem(const CFileItem *item)
{
  if (!item) return false;

  for (int i = 0; i < Size(); i++)
  {
    CFileItemPtr pItem = m_items[i];
    if (pItem->IsSamePath(item))
    {
      *pItem = *item;
      return true;
    }
  }
  return false;
}
Reply
#17
Should I make this change so m_items isn't directly accessed in the function?

Code:
CFileItemPtr pItem = m_items[i];
Code:
CFileItemPtr pItem = Get(i);
Reply
#18
No that doesn't matter at all. You can access m_items directly (though you might want to check if you need to hold the critical section - can't recall if there is one there or not). It probably makes sense to use m_items.size() in that case with an unsigned int or iterator.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#19
The pull request has been updated. Let me know what you think.
https://github.com/xbmc/xbmc/pull/843
Reply

Logout Mark Read Team Forum Stats Members Help
What is the purpose of this function?0