summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasem Mutlaq <mutlaqja@ikarustech.com>2016-06-02 12:31:39 (GMT)
committerArtem Fedoskin <afedoskin3@gmail.com>2016-06-05 22:24:47 (GMT)
commit8b21b252ec48c6ef1979bc0b6831414a6f3be7e8 (patch)
treed53fa2ade672921d5838a2b0198c61b6dd14d903
parent16eab86d4065be6d71f33d84daed8cacdcce32ce (diff)
Remove checking for duplicate strings since it is extremely inefficient
-rw-r--r--kstars/skycomponents/catalogcomponent.cpp4
-rw-r--r--kstars/skycomponents/deepskycomponent.cpp8
2 files changed, 8 insertions, 4 deletions
diff --git a/kstars/skycomponents/catalogcomponent.cpp b/kstars/skycomponents/catalogcomponent.cpp
index c60411f..31ee007 100644
--- a/kstars/skycomponents/catalogcomponent.cpp
+++ b/kstars/skycomponents/catalogcomponent.cpp
@@ -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);
}
}
diff --git a/kstars/skycomponents/deepskycomponent.cpp b/kstars/skycomponents/deepskycomponent.cpp
index a26f157..a4cec89 100644
--- a/kstars/skycomponents/deepskycomponent.cpp
+++ b/kstars/skycomponents/deepskycomponent.cpp
@@ -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();