mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[USETUP] Slightly optimize CONSOLE_SetStyledText (#5087)
Do not calculate Length unless necessary. CORE-18838
This commit is contained in:
parent
a5cd42c1ea
commit
b2cac5cd6c
1 changed files with 2 additions and 5 deletions
|
@ -675,13 +675,10 @@ CONSOLE_SetStyledText(
|
|||
IN LPCSTR Text)
|
||||
{
|
||||
COORD coPos;
|
||||
DWORD Length;
|
||||
|
||||
coPos.X = x;
|
||||
coPos.Y = y;
|
||||
|
||||
Length = (ULONG)strlen(Text);
|
||||
|
||||
if (Flags & TEXT_TYPE_STATUS)
|
||||
{
|
||||
coPos.X = x;
|
||||
|
@ -695,11 +692,11 @@ CONSOLE_SetStyledText(
|
|||
|
||||
if (Flags & TEXT_ALIGN_CENTER)
|
||||
{
|
||||
coPos.X = (xScreen - Length) / 2;
|
||||
coPos.X = (xScreen - (SHORT)strlen(Text)) / 2;
|
||||
}
|
||||
else if(Flags & TEXT_ALIGN_RIGHT)
|
||||
{
|
||||
coPos.X = coPos.X - Length;
|
||||
coPos.X = coPos.X - (SHORT)strlen(Text);
|
||||
|
||||
if (Flags & TEXT_PADDING_SMALL)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue