Permalink
Browse files

[loadfile] early return for better readability.

  • Loading branch information...
1 parent 230afda commit 31208ef6b9b1c7191d2eebcc4be4c61e0ad9e557 Jonathan Marshall committed with May 13, 2013
Showing with 3 additions and 5 deletions.
  1. +3 −5 xbmc/utils/FileUtils.cpp
@@ -142,8 +142,9 @@ unsigned int CFileUtils::LoadFile(const std::string &filename, void* &outputBuff
unsigned int inputBuffSize = 0;
XFILE::CFile file;
- if (file.Open(filename.c_str(), READ_TRUNCATED))
- {
+ if (!file.Open(filename.c_str(), READ_TRUNCATED))
+ return 0;
+
/*
GetLength() will typically return values that fall into three cases:
1. The real filesize. This is the typical case.
@@ -197,8 +198,5 @@ unsigned int CFileUtils::LoadFile(const std::string &filename, void* &outputBuff
outputBuffer = (void *) inputBuff;
return inputBuffSize;
- }
-
- return 0;
}

0 comments on commit 31208ef

Please sign in to comment.