Skip to content

Commit

Permalink
Remove useless unsigned comparisons <0
Browse files Browse the repository at this point in the history
  • Loading branch information
nico-abram committed Apr 2, 2018
1 parent b950fc5 commit b7212d3
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/ActorMultiVertex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1098,7 +1098,7 @@ class LunaActorMultiVertex: public Luna<ActorMultiVertex>
static size_t QuadStateIndex(T* p, lua_State *L, int pos)
{
size_t index = IArg(pos)-1;
if(index < 0 || index >= p->GetNumQuadStates())
if(index >= p->GetNumQuadStates())
{
luaL_error(L, "Invalid state index %d.", index+1);
}
Expand Down
3 changes: 0 additions & 3 deletions src/ScoreManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -453,9 +453,6 @@ void ScoreManager::SortTopSSRPtrs(Skillset ss, const string& profileID) {
}

HighScore* ScoreManager::GetTopSSRHighScore(unsigned int rank, int ss) {
if (rank < 0)
rank = 0;

if (ss >= 0 && ss < NUM_Skillset && rank < TopSSRs.size())
return TopSSRs[rank];

Expand Down
3 changes: 1 addition & 2 deletions src/ScreenNetSelectBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,7 @@ void ScreenNetSelectBase::Scroll(unsigned int movescroll)
{
if (NSMAN->IsETTP())
return;
if (scroll+movescroll >= 0 && scroll+movescroll <= m_textChatOutput.lines - SHOW_CHAT_LINES)
if (scroll+movescroll >= 0 && scroll+movescroll <= static_cast<unsigned int>(m_textChatOutput.lines - SHOW_CHAT_LINES))
if (scroll+movescroll <= m_textChatOutput.lines - SHOW_CHAT_LINES)
scroll += movescroll;
m_textChatOutput.ResetText();
m_textChatOutput.SetMaxLines(SHOW_CHAT_LINES, 1, scroll);
Expand Down

0 comments on commit b7212d3

Please sign in to comment.