src/ringFinder.cpp

changeset 1063
1f15c52c11f6
parent 1014
f0a8ecb6a357
child 1065
c8ecddbd99e9
--- a/src/ringFinder.cpp	Sat Jan 28 13:49:09 2017 +0200
+++ b/src/ringFinder.cpp	Sat Jan 28 14:01:19 2017 +0200
@@ -192,8 +192,8 @@
 {
 	// If one solution has less components than the other one, it is definitely
 	// better.
-	if (getComponents().size() != other->getComponents().size())
-		return getComponents().size() < other->getComponents().size();
+	if (length(getComponents()) != length(other->getComponents()))
+		return length(getComponents()) < length(other->getComponents());
 
 	// Calculate the maximum ring number. Since the solutions have equal
 	// ring counts, the solutions with lesser maximum rings should result
@@ -201,10 +201,10 @@
 	int maxA = 0,
 		maxB = 0;
 
-	for (int i = 0; i < getComponents().size(); ++i)
+	for (const Component& component : getComponents())
 	{
-		maxA = qMax (getComponents()[i].num, maxA);
-		maxB = qMax (other->getComponents()[i].num, maxB);
+		maxA = qMax (component.num, maxA);
+		maxB = qMax (component.num, maxB);
 	}
 
 	if (maxA != maxB)

mercurial