From 1b2e0589f19cb34d8cd58803677701dcf2161876 Mon Sep 17 00:00:00 2001 From: Andrei Lebedev Date: Fri, 15 Sep 2017 20:55:24 +0800 Subject: Fix rxcpp::observable<>::range() when T is unsigned type --- Rx/v2/src/rxcpp/sources/rx-range.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Rx/v2/src') diff --git a/Rx/v2/src/rxcpp/sources/rx-range.hpp b/Rx/v2/src/rxcpp/sources/rx-range.hpp index d55ffff..c56ee1f 100644 --- a/Rx/v2/src/rxcpp/sources/rx-range.hpp +++ b/Rx/v2/src/rxcpp/sources/rx-range.hpp @@ -86,7 +86,7 @@ struct range : public source_base return; } - if (std::abs(state.last - state.next) < std::abs(state.step)) { + if (std::max(state.last, state.next) - std::min(state.last, state.next) < std::abs(state.step)) { if (state.last != state.next) { dest.on_next(state.last); } -- cgit v1.2.3