Skip to content

Commit

Permalink
Fix limit StateSortOrder index
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan386 committed Sep 30, 2018
1 parent 535f529 commit 8e50823
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion shareaza/DownloadTransfer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ void CDownloadTransfer::SetState(int nState)
DWORD nOldSortOrder = m_pSource->m_nSortOrder;

//Assemble the sort order DWORD
m_pSource->m_nSortOrder = StateSortOrder[ min( nState, 14 ) ]; //Get state sort order
m_pSource->m_nSortOrder = StateSortOrder[ max( min( nState, 14 ), 0 ) ]; //Get state sort order

if ( m_pSource->m_nSortOrder >= 14 )
{ //Don't bother wasting CPU sorting 'dead' sources- Simply send to bottom.
Expand Down

0 comments on commit 8e50823

Please sign in to comment.