PVS 78-85: useless checks

* These were always true, so remove them.
This commit is contained in:
Adrien Destugues 2015-07-26 15:02:18 +02:00
parent 32a6b04592
commit 69ee6a6d62

View File

@ -181,13 +181,13 @@ BAppFileInfo::SetType(const char* type)
{
// check initialization
status_t error = B_OK;
if (error == B_OK && InitCheck() != B_OK)
if (InitCheck() != B_OK)
error = B_NO_INIT;
if (error == B_OK) {
if (type != NULL) {
// check param
size_t typeLen = strlen(type);
if (error == B_OK && typeLen >= B_MIME_TYPE_LENGTH)
if (typeLen >= B_MIME_TYPE_LENGTH)
error = B_BAD_VALUE;
// write the data
if (error == B_OK) {
@ -230,13 +230,13 @@ BAppFileInfo::SetSignature(const char* signature)
{
// check initialization
status_t error = B_OK;
if (error == B_OK && InitCheck() != B_OK)
if (B_OK && InitCheck() != B_OK)
error = B_NO_INIT;
if (error == B_OK) {
if (signature) {
// check param
size_t signatureLen = strlen(signature);
if (error == B_OK && signatureLen >= B_MIME_TYPE_LENGTH)
if (signatureLen >= B_MIME_TYPE_LENGTH)
error = B_BAD_VALUE;
// write the data
if (error == B_OK) {
@ -318,7 +318,7 @@ BAppFileInfo::SetAppFlags(uint32 flags)
{
// check initialization
status_t error = B_OK;
if (error == B_OK && InitCheck() != B_OK)
if (InitCheck() != B_OK)
error = B_NO_INIT;
if (error == B_OK) {
// write the data
@ -334,7 +334,7 @@ BAppFileInfo::RemoveAppFlags()
{
// check initialization
status_t error = B_OK;
if (error == B_OK && InitCheck() != B_OK)
if (InitCheck() != B_OK)
error = B_NO_INIT;
if (error == B_OK) {
// remove the data
@ -373,7 +373,7 @@ BAppFileInfo::SetSupportedTypes(const BMessage* types, bool updateMimeDB,
{
// check initialization
status_t error = B_OK;
if (error == B_OK && InitCheck() != B_OK)
if (InitCheck() != B_OK)
error = B_NO_INIT;
BMimeType mimeType;
@ -590,7 +590,7 @@ BAppFileInfo::SetVersionInfo(const version_info* info, version_kind kind)
{
// check initialization
status_t error = B_OK;
if (error == B_OK && InitCheck() != B_OK)
if (InitCheck() != B_OK)
error = B_NO_INIT;
if (error == B_OK) {
if (info != NULL) {