1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2024-11-22 17:39:53 +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

@ -314,16 +314,9 @@ UINT Count(COUNTER *c)
} }
Lock(c->lock); Lock(c->lock);
{
if (c->Ready == false)
{
ret = 0;
}
else
{ {
ret = c->c; ret = c->c;
} }
}
Unlock(c->lock); Unlock(c->lock);
return ret; return ret;
@ -344,17 +337,10 @@ UINT Inc(COUNTER *c)
} }
Lock(c->lock); Lock(c->lock);
{
if (c->Ready == false)
{
ret = 0;
}
else
{ {
c->c++; c->c++;
ret = c->c; ret = c->c;
} }
}
Unlock(c->lock); Unlock(c->lock);
// KS // KS
@ -379,12 +365,6 @@ UINT Dec(COUNTER *c)
} }
Lock(c->lock); Lock(c->lock);
{
if (c->Ready == false)
{
ret = 0;
}
else
{ {
if (c->c != 0) if (c->c != 0)
{ {
@ -396,7 +376,6 @@ UINT Dec(COUNTER *c)
ret = 0; ret = 0;
} }
} }
}
Unlock(c->lock); Unlock(c->lock);
// KS // KS