* scribo/core/component_info.hh,
* scribo/core/component_set.hh: Here.
---
scribo/ChangeLog | 7 +++++++
scribo/scribo/core/component_info.hh | 7 +++++--
scribo/scribo/core/component_set.hh | 10 +++++-----
3 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index d7e7547..ebf34aa 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,3 +1,10 @@
+2013-04-02 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Fix component_set comparison.
+
+ * scribo/core/component_info.hh,
+ * scribo/core/component_set.hh: Here.
+
2013-04-02 Guillaume Lazzara <lazzara(a)caroussel.lrde.epita.fr>
Improve time logging in Scribo.
diff --git a/scribo/scribo/core/component_info.hh b/scribo/scribo/core/component_info.hh
index d8e3381..384a2db 100644
--- a/scribo/scribo/core/component_info.hh
+++ b/scribo/scribo/core/component_info.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2009, 2010, 2011 EPITA Research and Development
+// Copyright (C) 2009, 2010, 2011, 2013 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
@@ -268,7 +268,10 @@ namespace scribo
&& lhs.bbox() == rhs.bbox()
&& lhs.mass_center() == rhs.mass_center()
&& lhs.card() == rhs.card()
- && lhs.features() == rhs.features()
+ && (lhs.has_features() == rhs.has_features()
+ || (lhs.has_features()
+ && rhs.has_features()
+ && lhs.features() == rhs.features()))
&& lhs.tag() == rhs.tag()
&& lhs.type() == rhs.type();
}
diff --git a/scribo/scribo/core/component_set.hh b/scribo/scribo/core/component_set.hh
index 789c752..eea385b 100644
--- a/scribo/scribo/core/component_set.hh
+++ b/scribo/scribo/core/component_set.hh
@@ -619,11 +619,14 @@ namespace scribo
bool
operator==(const component_set<L>& lhs, const component_set<L>&
rhs)
{
+ if (lhs.id_() == rhs.id_())
+ return true;
+
if (! (lhs.labeled_image() == rhs.labeled_image()))
- std::cout << "comp.lbl" << std::endl;
+ return false;
if (! (lhs.separators() == rhs.separators()))
- std::cout << "comp.seps" << std::endl;
+ return false;
if (! (lhs.nelements() == rhs.nelements()
&& lhs.labeled_image() == rhs.labeled_image()
@@ -632,10 +635,7 @@ namespace scribo
for_all_comps(c, lhs)
if (! (lhs(c) == rhs(c)))
- {
- std::cout << "comp.info" << std::endl;
return false;
- }
return true;
}
--
1.7.2.5