[glom] Document::remove_relationship(): Remove from the vector, not a copy.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom] Document::remove_relationship(): Remove from the vector, not a copy.
- Date: Mon, 28 Oct 2019 18:39:36 +0000 (UTC)
commit 9c081852f59a7d7e1d276b319917e235dc44fb9d
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 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/glom/libglom/document/document.cc b/glom/libglom/document/document.cc
index dd301a7a..0f2e8516 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]