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



commit c5f2b71d651efcb0d890bd104e27d1844302258a
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 038b2d8..841b22d 100644
--- a/glom/libglom/document/document.cc
+++ b/glom/libglom/document/document.cc
@@ -665,7 +665,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]