Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

String gives different size at "empty" input for short/non_short #190

Open
ChemistAion opened this issue Jun 22, 2023 · 1 comment
Open

Comments

@ChemistAion
Copy link

ChemistAion commented Jun 22, 2023

Continuing from: #189

Consider this:

constexpr auto limit = cista::generic_string<>::short_length_limit;
using string = cista::raw::string;

auto size_m3 = string("", limit - 3).size();
auto size_m1 = string("", limit - 1).size();
auto size_m0 = string("", limit - 0).size();
auto size_p0 = string("", limit + 0).size();
auto size_p1 = string("", limit + 1).size();
auto size_p3 = string("", limit + 3).size();

Everything above small-optimization limit gives "right size", i.e.: size_p1 is 16 and size_p3 is 18, whereas non-heaps gives 0.
Would be nice to get consistent behavior here.

...be sparkled 🥳 by an idea from: #187 (comment)

@ChemistAion
Copy link
Author

I will check the impact here of what @khng300 did in the: #187

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant