Skip to content
Browse files

reuse GetStreamId() so we can get rid of one operator overload

  • Loading branch information...
1 parent 07a3e7d commit 8cda625c354fe657c0fc824518fb69c89eb8f5e6 @Jalle19 Jalle19 committed Jan 2, 2014
Showing with 4 additions and 17 deletions.
  1. +4 −17 xbmc/xbmc_stream_utils.hpp
View
21 xbmc/xbmc_stream_utils.hpp
@@ -49,16 +49,6 @@ namespace ADDON
}
/**
- * Compares this stream based on a physical ID
- * @param _iPhysicalId
- * @return
- */
- inline bool operator==(unsigned int _iPhysicalId) const
- {
- return iPhysicalId == _iPhysicalId;
- }
-
- /**
* Compares this stream based on another stream
* @param other
* @return
@@ -148,18 +138,15 @@ namespace ADDON
}
/**
- * Returns the stream with the specified physical ID
+ * Returns the stream with the specified physical ID, or null if no such
+ * stream exists
* @param iPhysicalId
* @return
*/
XbmcPvrStream* GetStreamById(unsigned int iPhysicalId) const
{
- stream_vector::iterator it = std::find(m_streamVector->begin(),
- m_streamVector->end(), iPhysicalId);
- if (it != m_streamVector->end())
- return &(*it);
-
- return NULL;
+ int position = GetStreamId(iPhysicalId);
+ return position != -1 ? &m_streamVector->at(position) : NULL;
}
/**

0 comments on commit 8cda625

Please sign in to comment.
Something went wrong with that request. Please try again.