From 06431b9a492fec17ad539416464c54a6f05c5447 Mon Sep 17 00:00:00 2001 From: "Kirk Shoop (MS Open Tech)" Date: Fri, 27 Sep 2013 07:12:53 -0700 Subject: fix bug when using where on an empty collection --- Ix/CPP/src/cpplinq/linq_where.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Ix') diff --git a/Ix/CPP/src/cpplinq/linq_where.hpp b/Ix/CPP/src/cpplinq/linq_where.hpp index 4f66ba7..9b3d936 100644 --- a/Ix/CPP/src/cpplinq/linq_where.hpp +++ b/Ix/CPP/src/cpplinq/linq_where.hpp @@ -24,7 +24,7 @@ namespace cpplinq cursor(const inner_cursor& cur, const Predicate& p) : cur(cur), pred(p) { - if (!pred(cur.get())) { + if (!cur.empty() && !pred(cur.get())) { this->inc(); } } -- cgit v1.2.3