Inline one-expression single-use functions (#1700)
This commit is contained in:
parent
8579e873ca
commit
dc8a22a76a
@ -235,7 +235,7 @@ public int Handler_VoteCallback(Menu menu, MenuAction action, int param1, int pa
|
||||
{
|
||||
if (action == MenuAction_End)
|
||||
{
|
||||
VoteMenuClose();
|
||||
delete g_hVoteMenu;
|
||||
}
|
||||
else if (action == MenuAction_Display)
|
||||
{
|
||||
@ -286,7 +286,7 @@ public int Handler_VoteCallback(Menu menu, MenuAction action, int param1, int pa
|
||||
votes = totalVotes - votes; // Reverse the votes to be in relation to the Yes option.
|
||||
}
|
||||
|
||||
percent = GetVotePercent(votes, totalVotes);
|
||||
percent = float(votes) / float(totalVotes);
|
||||
|
||||
if (g_voteType != VoteType_Question)
|
||||
{
|
||||
@ -404,16 +404,6 @@ void VoteSelect(Menu menu, int param1, int param2 = 0)
|
||||
}
|
||||
*/
|
||||
|
||||
void VoteMenuClose()
|
||||
{
|
||||
delete g_hVoteMenu;
|
||||
}
|
||||
|
||||
float GetVotePercent(int votes, int totalVotes)
|
||||
{
|
||||
return float(votes) / float(totalVotes);
|
||||
}
|
||||
|
||||
bool TestVoteDelay(int client)
|
||||
{
|
||||
int delay = CheckVoteDelay();
|
||||
|
@ -167,7 +167,7 @@ public int Handler_VoteCallback(Menu menu, MenuAction action, int param1, int pa
|
||||
{
|
||||
if (action == MenuAction_End)
|
||||
{
|
||||
VoteMenuClose();
|
||||
delete g_hVoteMenu;
|
||||
}
|
||||
else if (action == MenuAction_Display)
|
||||
{
|
||||
@ -215,7 +215,7 @@ public int Handler_VoteCallback(Menu menu, MenuAction action, int param1, int pa
|
||||
votes = totalVotes - votes; // Reverse the votes to be in relation to the Yes option.
|
||||
}
|
||||
|
||||
percent = GetVotePercent(votes, totalVotes);
|
||||
percent = float(votes) / float(totalVotes);
|
||||
|
||||
limit = g_Cvar_Limits[g_voteType].FloatValue;
|
||||
|
||||
@ -306,16 +306,6 @@ void VoteSelect(Menu menu, int param1, int param2 = 0)
|
||||
}
|
||||
*/
|
||||
|
||||
void VoteMenuClose()
|
||||
{
|
||||
delete g_hVoteMenu;
|
||||
}
|
||||
|
||||
float GetVotePercent(int votes, int totalVotes)
|
||||
{
|
||||
return float(votes) / float(totalVotes);
|
||||
}
|
||||
|
||||
bool TestVoteDelay(int client)
|
||||
{
|
||||
int delay = CheckVoteDelay();
|
||||
|
Loading…
Reference in New Issue
Block a user