From bfc1a0ee52e2dca8ba7053f7720bb9c449cbc99e Mon Sep 17 00:00:00 2001 From: srn Date: Thu, 1 Nov 2007 11:48:50 +0000 Subject: [PATCH] Optimized GetSObject method --- src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx index 0cf6bc47a..ad9c0c1ef 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx @@ -1072,7 +1072,16 @@ SALOMEDSImpl_SObject SALOMEDSImpl_Study::GetSObject(const string& theEntry) //============================================================================ SALOMEDSImpl_SObject SALOMEDSImpl_Study::GetSObject(const DF_Label& theLabel) { - return GetSObject(theLabel.Entry()); + SALOMEDSImpl_SObject aSO; + string anEntry = theLabel.Entry(); + if(_mapOfSO.find(anEntry) != _mapOfSO.end()) + aSO = _mapOfSO[anEntry]; + else { + aSO = SALOMEDSImpl_SObject(theLabel); + _mapOfSO[anEntry] = aSO; + } + + return aSO; } //============================================================================ -- 2.39.2