1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2024-12-27 02:29:52 +03:00

src/Mayaqua/Object.c: remove redundant conditionals

found by PVS analyzer

src/Mayaqua/Object.c	318	warn	V547 Expression 'c->Ready == 0' is always false.
src/Mayaqua/Object.c	348	warn	V547 Expression 'c->Ready == 0' is always false.
src/Mayaqua/Object.c	383	warn	V547 Expression 'c->Ready == 0' is always false.
This commit is contained in:
Ilya Shipitsin 2018-09-29 00:39:01 +05:00
parent 60bb1c34de
commit 564ca6087f

View File

@ -315,14 +315,7 @@ UINT Count(COUNTER *c)
Lock(c->lock);
{
if (c->Ready == false)
{
ret = 0;
}
else
{
ret = c->c;
}
ret = c->c;
}
Unlock(c->lock);
@ -345,15 +338,8 @@ UINT Inc(COUNTER *c)
Lock(c->lock);
{
if (c->Ready == false)
{
ret = 0;
}
else
{
c->c++;
ret = c->c;
}
c->c++;
ret = c->c;
}
Unlock(c->lock);
@ -380,21 +366,14 @@ UINT Dec(COUNTER *c)
Lock(c->lock);
{
if (c->Ready == false)
if (c->c != 0)
{
ret = 0;
c->c--;
ret = c->c;
}
else
{
if (c->c != 0)
{
c->c--;
ret = c->c;
}
else
{
ret = 0;
}
ret = 0;
}
}
Unlock(c->lock);