Performance optimization: empty() instead of size()>0
empty() is guaranteed to be constant complexity for both vectors and lists, while size() has linear complexity for lists.
This commit is contained in:
parent
1f88d1d11b
commit
b27eb2571c
1 changed files with 1 additions and 1 deletions
|
@ -893,7 +893,7 @@ void FGNasalSys::loadScriptDirectory(simgear::Dir nasalDir)
|
||||||
// Create module with list of scripts
|
// Create module with list of scripts
|
||||||
void FGNasalSys::addModule(string moduleName, simgear::PathList scripts)
|
void FGNasalSys::addModule(string moduleName, simgear::PathList scripts)
|
||||||
{
|
{
|
||||||
if (scripts.size()>0)
|
if (! scripts.empty())
|
||||||
{
|
{
|
||||||
SGPropertyNode* nasal = globals->get_props()->getNode("nasal");
|
SGPropertyNode* nasal = globals->get_props()->getNode("nasal");
|
||||||
SGPropertyNode* module_node = nasal->getChild(moduleName,0,true);
|
SGPropertyNode* module_node = nasal->getChild(moduleName,0,true);
|
||||||
|
|
Loading…
Reference in a new issue