diff --git a/include/dxfeed_graal_cpp_api/internal/Common.hpp b/include/dxfeed_graal_cpp_api/internal/Common.hpp index 638aef8c..453c5f84 100644 --- a/include/dxfeed_graal_cpp_api/internal/Common.hpp +++ b/include/dxfeed_graal_cpp_api/internal/Common.hpp @@ -932,24 +932,16 @@ inline void checkChar(char c, std::uint32_t mask, const std::string &name) { namespace math { -template -ResultType normalizeComparatorResult(ComparatorResultType r) { - if constexpr (std::is_signed_v) { - return r < 0 ? -1 : r > 0 ? 1 : 0; - } else { - auto result = static_cast>(r); - - return result < 0 ? -1 : result > 0 ? 1 : 0; +template ResultType compare(Type v1, Type v2) { + if (v1 < v2) { + return -1; } -} -template ResultType compare(Type v1, Type v2) { - if constexpr (std::is_signed_v) { - return normalizeComparatorResult(v1 - v2); - } else { - return normalizeComparatorResult(static_cast>(v1) - - static_cast>(v2)); + if (v2 < v1) { + return 1; } + + return 0; } inline int compare(double d1, double d2) { diff --git a/samples/cpp/DxFeedConnect/src/main.cpp b/samples/cpp/DxFeedConnect/src/main.cpp index 225a52f8..47b17283 100644 --- a/samples/cpp/DxFeedConnect/src/main.cpp +++ b/samples/cpp/DxFeedConnect/src/main.cpp @@ -54,63 +54,6 @@ DxFeedConnect
[