src: fix crash on edit project

* fixed crash when comparing two vectors of different sizes.
This commit is contained in:
malte_langkabel
2016-01-25 16:40:28 +01:00
parent 1209d0e7c0
commit 8addbb2195
+4 -1
View File
@@ -39,7 +39,10 @@ namespace utility
template<typename T>
bool isPermutation(const std::vector<T>& a, const std::vector<T>& b)
{
return std::is_permutation(a.begin(), a.end(), b.begin());
return (
a.size() == b.size() &&
std::is_permutation(a.begin(), a.end(), b.begin())
);
}
bool intersectionPoint(Vec2f a1, Vec2f b1, Vec2f a2, Vec2f b2, Vec2f* i);