Commit 8b21b252 authored by Jasem Mutlaq's avatar Jasem Mutlaq Committed by Artem Fedoskin
Browse files

Remove checking for duplicate strings since it is extremely inefficient

parent 16eab86d
......@@ -64,7 +64,9 @@ void CatalogComponent::loadData() {
this);
for (int iter = 0; iter < names.size(); iter++) {
if (names.at(iter).first <= SkyObject::TYPE_UNKNOWN) {
if (!objectNames(names.at(iter).first).contains(names.at(iter).second))
//FIXME JM 2016-06-02: inefficient and costly check
// Need better way around this
//if (!objectNames(names.at(iter).first).contains(names.at(iter).second))
objectNames(names.at(iter).first).append(names.at(iter).second);
}
}
......
......@@ -306,12 +306,14 @@ void DeepSkyComponent::loadData()
appendIndex( o, &m_OtherIndex, trixel );
}
//Add name to the list of object names if it does not exist already
if ( ! name.isEmpty() && !objectNames(type).contains(name))
// JM: VERY INEFFICIENT. Disabling for now until we figure out how to deal with dups. QSet?
//if ( ! name.isEmpty() && !objectNames(type).contains(name))
if ( ! name.isEmpty() )
objectNames(type).append( name );
//Add long name to the list of object names
if ( ! longname.isEmpty() && longname != name && !objectNames(type).contains(longname))
//if ( ! longname.isEmpty() && longname != name && !objectNames(type).contains(longname))
if ( ! longname.isEmpty() && longname != name)
objectNames(type).append( longname );
deep_sky_parser.ShowProgress();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment