Used single quotes for single character in string::find algorithm, more efficient
This commit is contained in:
@@ -792,7 +792,7 @@ int getSWIGVersionFromModule(const std::string& module)
|
||||
Py::String file(mod.getAttr("__file__"));
|
||||
std::string filename = (std::string)file;
|
||||
// file can have the extension .py or .pyc
|
||||
filename = filename.substr(0, filename.rfind("."));
|
||||
filename = filename.substr(0, filename.rfind('.'));
|
||||
filename += ".py";
|
||||
boost::regex rx("^# Version ([1-9])\\.([0-9])\\.([0-9]+)");
|
||||
boost::cmatch what;
|
||||
|
||||
@@ -317,7 +317,7 @@ void FileWriter::writeFiles(void)
|
||||
if (shouldWrite(entry.FileName, entry.Object)) {
|
||||
std::string filePath = entry.FileName;
|
||||
std::string::size_type pos = 0;
|
||||
while ((pos = filePath.find("/", pos)) != std::string::npos) {
|
||||
while ((pos = filePath.find('/', pos)) != std::string::npos) {
|
||||
std::string dirName = DirName + "/" + filePath.substr(0, pos);
|
||||
pos++;
|
||||
Base::FileInfo fi(dirName);
|
||||
|
||||
Reference in New Issue
Block a user