[NETSTAT] Optimize a bit (#5405)

in netstat.c 100% of the calls to
    DisplayTableHeader();
have in the exact line beforehand a call to
    ConResPuts(StdOut, IDS_ACTIVE_CONNECT);

So let's fuse them.

Also fix a superfluous space in the *.rc files before it will get duplicated
a thousand times.
This commit is contained in:
Joachim Henze 2023-07-05 20:52:04 +02:00 committed by GitHub
parent 3e23cdf9ee
commit 8ef47d2e5e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 8 deletions

View file

@ -63,6 +63,7 @@ VOID DoFormatMessage(DWORD ErrorCode)
*/
VOID DisplayTableHeader(VOID)
{
ConResPuts(StdOut, IDS_ACTIVE_CONNECT);
ConResPuts(StdOut, IDS_DISPLAY_THEADER);
if (bDoShowProcessId)
ConResPuts(StdOut, IDS_DISPLAY_PROCESS);
@ -115,7 +116,6 @@ BOOL ParseCmdline(int argc, wchar_t* argv[])
bDoShowProtoCons = TRUE;
if (i+1 >= argc)
{
ConResPuts(StdOut, IDS_ACTIVE_CONNECT);
DisplayTableHeader();
return TRUE;
}
@ -173,7 +173,6 @@ BOOL DisplayOutput(VOID)
{
if (bNoOptions)
{
ConResPuts(StdOut, IDS_ACTIVE_CONNECT);
DisplayTableHeader();
return ShowTcpTable();
}
@ -209,13 +208,11 @@ BOOL DisplayOutput(VOID)
case TCP:
if (bDoShowProtoStats)
ShowTcpStatistics();
ConResPuts(StdOut, IDS_ACTIVE_CONNECT);
DisplayTableHeader();
return ShowTcpTable();
case UDP:
if (bDoShowProtoStats)
ShowUdpStatistics();
ConResPuts(StdOut, IDS_ACTIVE_CONNECT);
DisplayTableHeader();
return (bDoShowAllCons ? ShowUdpTable() : TRUE);
default:
@ -232,7 +229,6 @@ BOOL DisplayOutput(VOID)
}
else
{
ConResPuts(StdOut, IDS_ACTIVE_CONNECT);
DisplayTableHeader();
if (ShowTcpTable() && bDoShowAllCons)
ShowUdpTable();