mirror of
https://github.com/textmate/textmate.git
synced 2026-01-21 04:38:13 -05:00
Use path::is_child instead of custom code
This commit is contained in:
@@ -2273,7 +2273,7 @@ static NSUInteger DisableSessionSavingCount = 0;
|
||||
std::string const projectPath = to_s(candidate.projectPath);
|
||||
iterate(parent, parents)
|
||||
{
|
||||
if(parent->find(projectPath) == 0 && (parent->size() == projectPath.size() || (*parent)[projectPath.size()] == '/'))
|
||||
if(path::is_child(*parent, projectPath))
|
||||
candidates.insert(std::make_pair(parent->size() - projectPath.size(), candidate));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ _Iter prune_path_parents (_Iter it, _Iter last)
|
||||
std::reverse(it, last);
|
||||
for(std::string child = NULL_STR; it != last; child = *it++)
|
||||
{
|
||||
if(child.size() <= it->size() || child.at(it->size()) != '/' || child.find(*it) != 0)
|
||||
if(!path::is_child(child, *it))
|
||||
*out++ = *it;
|
||||
}
|
||||
return out;
|
||||
@@ -60,7 +60,7 @@ _Iter prune_path_children (_Iter it, _Iter last)
|
||||
std::sort(it, last);
|
||||
for(std::string parent = NULL_STR; it != last; ++it)
|
||||
{
|
||||
if(it->size() <= parent.size() || it->at(parent.size()) != '/' || it->find(parent) != 0)
|
||||
if(!path::is_child(*it, parent))
|
||||
*out++ = parent = *it;
|
||||
}
|
||||
return out;
|
||||
|
||||
Reference in New Issue
Block a user