Inline one-expression single-use functions (#1700)

This commit is contained in:
V 2022-02-25 14:39:45 +05:00 committed by Your Name
parent 7648c7fe03
commit 3a2c5cb0f7
2 changed files with 4 additions and 24 deletions

View File

@ -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();

View File

@ -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();