[glom/gtkmm4v4] Document::remove_relationship(): Remove from the vector, not a copy.



commit 3a825bcbf48558cb4a8f603fb91ceb3974d42982
Author: Murray Cumming <murrayc murrayc com>
Date:   Tue Jun 20 20:36:24 2017 +0200

    Document::remove_relationship(): Remove from the vector, not a copy.
    
    This was probably a regression since converting to use of auto with
    C++11.

 glom/libglom/document/document.cc |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/glom/libglom/document/document.cc b/glom/libglom/document/document.cc
index dd301a7..0f2e851 100644
--- a/glom/libglom/document/document.cc
+++ b/glom/libglom/document/document.cc
@@ -658,7 +658,8 @@ void Document::remove_relationship(const std::shared_ptr<const Relationship>& re
   const auto relationship_name = glom_get_sharedptr_name(relationship);
 
   //Find the relationship and remove it:
-  auto relationships = info->m_relationships;
+  auto& relationships = info->m_relationships;
+
   auto iterRel = find_if_same_name(relationships, relationship_name);
   if(iterRel != relationships.end())
   {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]