mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 14:58:33 +08:00
Minor performance improvement of subdir check
* follow T689 * no need to always get and init simulator directory as it will not change
This commit is contained in:
committed by
Mat Sutcliffe
parent
3dde201df0
commit
58b7c875bc
@@ -567,11 +567,16 @@ namespace BlackSimPlugin
|
||||
if (package.isEmpty()) { continue; }
|
||||
packages.insert(it, { package.append('/') });
|
||||
}
|
||||
|
||||
// comment KB 2019-06
|
||||
// a package is one xsb_aircraft.txt file BB has 9, X-CSL has 76
|
||||
// the reason for the append("/")/chop "/" is explained here: https://discordapp.com/channels/539048679160676382/539925070550794240/594891288751505418
|
||||
const QDir simDir = getSimulatorSettings().getSimulatorDirectoryOrDefault();
|
||||
for (auto &package : packages)
|
||||
{
|
||||
Q_ASSERT(package.s.endsWith('/'));
|
||||
package.s.chop(1);
|
||||
if (CDirectoryUtils::isSubDirectoryOf(package.s, getSimulatorSettings().getSimulatorDirectoryOrDefault()))
|
||||
if (CDirectoryUtils::isSubDirectoryOf(package.s, simDir))
|
||||
{
|
||||
m_trafficProxy->loadPlanesPackage(package.s);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user