[Scummvm-cvs-logs] SF.net SVN: scummvm: [26602] scummvm/trunk/common/advancedDetector.cpp
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Thu Apr 26 22:40:29 CEST 2007
Revision: 26602
http://scummvm.svn.sourceforge.net/scummvm/?rev=26602&view=rev
Author: fingolfin
Date: 2007-04-26 13:40:28 -0700 (Thu, 26 Apr 2007)
Log Message:
-----------
More cleanup
Modified Paths:
--------------
scummvm/trunk/common/advancedDetector.cpp
Modified: scummvm/trunk/common/advancedDetector.cpp
===================================================================
--- scummvm/trunk/common/advancedDetector.cpp 2007-04-26 20:36:52 UTC (rev 26601)
+++ scummvm/trunk/common/advancedDetector.cpp 2007-04-26 20:40:28 UTC (rev 26602)
@@ -254,6 +254,8 @@
IntMap filesSize;
IntMap allFiles;
+ File testFile;
+
String tstr;
uint i;
@@ -280,17 +282,15 @@
if (fslist != 0) {
// Get the information of the existing files
for (FSList::const_iterator file = fslist->begin(); file != fslist->end(); ++file) {
- Common::File f;
-
if (file->isDirectory()) continue;
tstr = file->name();
tstr.toLowercase();
- // Strip the trailing dot
+ // Strip any trailing dot
if (tstr.lastChar() == '.')
tstr.deleteLastChar();
- allFiles[tstr] = 1;
+ allFiles[tstr] = true;
debug(3, "+ %s", tstr.c_str());
@@ -302,15 +302,13 @@
debug(3, "> %s: %s", tstr.c_str(), md5str);
- if (f.open(file->path())) {
- filesSize[tstr] = (int32)f.size();
- f.close();
+ if (testFile.open(file->path())) {
+ filesSize[tstr] = (int32)testFile.size();
+ testFile.close();
}
}
} else {
// Get the information of the requested files
- File testFile;
-
for (StringSet::const_iterator file = filesList.begin(); file != filesList.end(); ++file) {
tstr = file->_key;
@@ -425,8 +423,6 @@
// First we create list of files required for detection.
// The filenames can be different than the MD5 based match ones.
- File testFile;
-
for (; ptr->desc; ptr++) {
filenames = ptr->filenames;
for (; *filenames; filenames++) {
@@ -435,7 +431,7 @@
if (!allFiles.contains(tstr)) {
if (testFile.open(tstr) || testFile.open(tstr + ".")) {
- allFiles[tstr] = 1;
+ allFiles[tstr] = true;
testFile.close();
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list