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