From 8e07b7e05002e246d785b3c6d7b35ace6bdb68b1 Mon Sep 17 00:00:00 2001 From: "Alexander \"Ace\" Olofsson" Date: Sat, 31 Mar 2012 00:54:49 +0200 Subject: [PATCH] Better (less) debug output --- components/bsa/bsa_archive.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/components/bsa/bsa_archive.cpp b/components/bsa/bsa_archive.cpp index 9d7212a5c..650127159 100644 --- a/components/bsa/bsa_archive.cpp +++ b/components/bsa/bsa_archive.cpp @@ -101,37 +101,34 @@ class DirArchive: public Ogre::FileSystemArchive delimiter = lastSlash+1; } - std::cout << "Finding: " << copy; - std::vector current; { std::map,ciLessBoost>::const_iterator found = m.find(folder); if (found == m.end()) { - std::cout << " failed, couldn't find folder." << std::endl; return false; } else current = found->second; } + std::cout << "Finding: " << copy; + pathComparer comp(delimiter, copy.size() - delimiter-1); std::vector::iterator find = std::lower_bound(current.begin(), current.end(), copy, comp); if (find != current.end() && !comp(copy, current.front())) { std::cout << " found"; - if (copy != *find) - if (lexicographical_compare(copy, *find, boost::algorithm::is_iless())) - std::cout << " case folded to " << *find << std::endl; - else - std::cout << " as different file " << *find << std::endl; + if (copy != *find && !lexicographical_compare(copy, *find, boost::algorithm::is_iless())) + std::cout << ", as different file " << *find; + std::cout << "." << std::endl; copy = *find; return true; } - std::cout << " failed, couldn't find file." << std::endl; + std::cout << " failed." << std::endl; return false; }