From 622ac935fd1d8a5bc282ee127666a3e9d1954713 Mon Sep 17 00:00:00 2001 From: mpv Date: Thu, 28 Apr 2016 14:18:44 +0300 Subject: [PATCH] Fix compilation on Linux --- src/Model/Model_AttributeSelectionList.cpp | 6 +++--- src/Model/Model_AttributeSelectionList.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Model/Model_AttributeSelectionList.cpp b/src/Model/Model_AttributeSelectionList.cpp index 86581b348..9fbef11c6 100644 --- a/src/Model/Model_AttributeSelectionList.cpp +++ b/src/Model/Model_AttributeSelectionList.cpp @@ -187,12 +187,12 @@ bool Model_AttributeSelectionList::isInList(const ResultPtr& theContext, const std::shared_ptr& theSubShape, const bool theTemporarily) { - if (myCash.size()) { // the cashing is active - std::map > >::iterator aContext = + if (!myCash.empty()) { // the cashing is active + std::map > >::iterator aContext = myCash.find(theContext); if (aContext != myCash.end()) { // iterate shapes because "isEqual" method must be called for each shape - std::list >::iterator aShapes = aContext->second.begin(); + std::list >::iterator aShapes = aContext->second.begin(); for(; aShapes != aContext->second.end(); aShapes++) { if (!theSubShape.get()) { if (!aShapes->get()) diff --git a/src/Model/Model_AttributeSelectionList.h b/src/Model/Model_AttributeSelectionList.h index 2df86e31d..99f2dfdd8 100644 --- a/src/Model/Model_AttributeSelectionList.h +++ b/src/Model/Model_AttributeSelectionList.h @@ -28,7 +28,7 @@ class Model_AttributeSelectionList : public ModelAPI_AttributeSelectionList Handle(TDataStd_Comment) mySelectionType; std::shared_ptr myTmpAttr; ///< temporary attribute (the last one) /// the cashed shapes to optimize isInList method: from context to set of shapes in this context - std::map > > myCash; + std::map > > myCash; public: /// Adds the new reference to the end of the list /// \param theContext object where the sub-shape was selected -- 2.39.2