From 3ec680083978d2e840ba9557881653e00e321a30 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sun, 26 Jul 2015 15:31:43 +0200 Subject: [PATCH] PVS 109: useless check error was already checked one line above. --- src/kits/storage/ResourceFile.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/kits/storage/ResourceFile.cpp b/src/kits/storage/ResourceFile.cpp index 48d55651d3..6885bccc57 100644 --- a/src/kits/storage/ResourceFile.cpp +++ b/src/kits/storage/ResourceFile.cpp @@ -310,9 +310,9 @@ ResourceFile::ReadResource(ResourceItem& resource, bool force) status_t error = InitCheck(); size_t size = resource.DataSize(); if (error == B_OK && (force || !resource.IsLoaded())) { - if (error == B_OK) - error = resource.SetSize(size); void* data = NULL; + error = resource.SetSize(size); + if (error == B_OK) { data = resource.Data(); ssize_t bytesRead = fFile.ReadAt(resource.Offset(), data, size);