[Kst] extragear/graphics/kst/kst
George Staikos
staikos at kde.org
Wed Oct 26 03:38:37 CEST 2005
SVN commit 474309 by staikos:
don't keep looking up in the map if we don't need to
M +30 -24 kstvcurve.cpp
--- trunk/extragear/graphics/kst/kst/kstvcurve.cpp #474308:474309
@@ -200,53 +200,59 @@
return lastUpdateResult();
}
- if (!_inputVectors.contains(COLOR_XVECTOR) || !_inputVectors.contains(COLOR_YVECTOR)) {
+ KstVectorPtr cxV = *_inputVectors.find(COLOR_XVECTOR);
+ KstVectorPtr cyV = *_inputVectors.find(COLOR_YVECTOR);
+ if (!cxV || !cyV) {
return setLastUpdateResult(NO_CHANGE);
}
bool depUpdated = force;
- depUpdated = UPDATE == _inputVectors[COLOR_XVECTOR]->update(update_counter) || depUpdated;
- depUpdated = UPDATE == _inputVectors[COLOR_YVECTOR]->update(update_counter) || depUpdated;
+ depUpdated = UPDATE == cxV->update(update_counter) || depUpdated;
+ depUpdated = UPDATE == cyV->update(update_counter) || depUpdated;
- if (_inputVectors.contains(EXVECTOR)) {
- depUpdated = UPDATE == _inputVectors[EXVECTOR]->update(update_counter) || depUpdated;
+ KstVectorPtr exV = *_inputVectors.find(EXVECTOR);
+ if (exV) {
+ depUpdated = UPDATE == exV->update(update_counter) || depUpdated;
}
- if (_inputVectors.contains(EYVECTOR)) {
- depUpdated = UPDATE == _inputVectors[EYVECTOR]->update(update_counter) || depUpdated;
+ KstVectorPtr eyV = *_inputVectors.find(EYVECTOR);
+ if (eyV) {
+ depUpdated = UPDATE == eyV->update(update_counter) || depUpdated;
}
- if (_inputVectors.contains(EXMINUSVECTOR)) {
- depUpdated = UPDATE == _inputVectors[EXMINUSVECTOR]->update(update_counter) || depUpdated;
+ KstVectorPtr exmV = *_inputVectors.find(EXMINUSVECTOR);
+ if (exmV) {
+ depUpdated = UPDATE == exmV->update(update_counter) || depUpdated;
}
- if (_inputVectors.contains(EYMINUSVECTOR)) {
- depUpdated = UPDATE == _inputVectors[EYMINUSVECTOR]->update(update_counter) || depUpdated;
+ KstVectorPtr eymV = *_inputVectors.find(EYMINUSVECTOR);
+ if (eymV) {
+ depUpdated = UPDATE == eymV->update(update_counter) || depUpdated;
}
- MaxX = _inputVectors[COLOR_XVECTOR]->max();
- MinX = _inputVectors[COLOR_XVECTOR]->min();
- MeanX = _inputVectors[COLOR_XVECTOR]->mean();
- MinPosX = _inputVectors[COLOR_XVECTOR]->minPos();
- _ns_maxx = _inputVectors[COLOR_XVECTOR]->ns_max();
- _ns_minx = _inputVectors[COLOR_XVECTOR]->ns_min();
+ MaxX = cxV->max();
+ MinX = cxV->min();
+ MeanX = cxV->mean();
+ MinPosX = cxV->minPos();
+ _ns_maxx = cxV->ns_max();
+ _ns_minx = cxV->ns_min();
if (MinPosX > MaxX) {
MinPosX = 0;
}
- MaxY = _inputVectors[COLOR_YVECTOR]->max();
- MinY = _inputVectors[COLOR_YVECTOR]->min();
- MeanY = _inputVectors[COLOR_YVECTOR]->mean();
- MinPosY = _inputVectors[COLOR_YVECTOR]->minPos();
- _ns_maxy = _inputVectors[COLOR_YVECTOR]->ns_max();
- _ns_miny = _inputVectors[COLOR_YVECTOR]->ns_min();
+ MaxY = cyV->max();
+ MinY = cyV->min();
+ MeanY = cyV->mean();
+ MinPosY = cyV->minPos();
+ _ns_maxy = cyV->ns_max();
+ _ns_miny = cyV->ns_min();
if (MinPosY > MaxY) {
MinPosY = 0;
}
- NS = QMAX(_inputVectors[COLOR_XVECTOR]->length(), _inputVectors[COLOR_YVECTOR]->length());
+ NS = QMAX(cxV->length(), cyV->length());
return setLastUpdateResult(depUpdated ? UPDATE : NO_CHANGE);
}
More information about the Kst
mailing list