From 37831a0771bc0efae5d4ed6f9b7fb56e0ebe4537 Mon Sep 17 00:00:00 2001 From: Andersama Date: Wed, 9 Jun 2021 12:41:35 -0700 Subject: [PATCH] patch: optimized adding any Instead of inserting, modify the point set to its new equivalent form. --- include/ctre/first.hpp | 4 +++- single-header/ctre-unicode.hpp | 4 +++- single-header/ctre.hpp | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/include/ctre/first.hpp b/include/ctre/first.hpp index ceb02500..5d13a5aa 100644 --- a/include/ctre/first.hpp +++ b/include/ctre/first.hpp @@ -495,7 +495,9 @@ template class point_set { insert(A,B); } constexpr void populate(can_be_anything) { - insert(std::numeric_limits::min(), std::numeric_limits::max()); + points[0].low = std::numeric_limits::min(); + points[0].high = std::numeric_limits::max(); + used = 1; } template constexpr void populate(ctre::negative_set nset) { negative_helper(nset, [&](int64_t low, int64_t high){ diff --git a/single-header/ctre-unicode.hpp b/single-header/ctre-unicode.hpp index cbd50949..6d31cfbf 100644 --- a/single-header/ctre-unicode.hpp +++ b/single-header/ctre-unicode.hpp @@ -3933,7 +3933,9 @@ template class point_set { insert(A,B); } constexpr void populate(can_be_anything) { - insert(std::numeric_limits::min(), std::numeric_limits::max()); + points[0].low = std::numeric_limits::min(); + points[0].high = std::numeric_limits::max(); + used = 1; } template constexpr void populate(ctre::negative_set nset) { negative_helper(nset, [&](int64_t low, int64_t high){ diff --git a/single-header/ctre.hpp b/single-header/ctre.hpp index 23ce528c..d8ab650c 100644 --- a/single-header/ctre.hpp +++ b/single-header/ctre.hpp @@ -3930,7 +3930,9 @@ template class point_set { insert(A,B); } constexpr void populate(can_be_anything) { - insert(std::numeric_limits::min(), std::numeric_limits::max()); + points[0].low = std::numeric_limits::min(); + points[0].high = std::numeric_limits::max(); + used = 1; } template constexpr void populate(ctre::negative_set nset) { negative_helper(nset, [&](int64_t low, int64_t high){