summaryrefslogtreecommitdiff
path: root/AK/FlyString.cpp
AgeCommit message (Collapse)Author
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-02-26Everywhere: Remove a bunch of redundant 'AK::' namespace prefixesLinus Groh
This is basically just for consistency, it's quite strange to see multiple AK container types next to each other, some with and some without the namespace prefix - we're 'using AK::Foo;' a lot and should leverage that. :^)
2021-02-23Everywhere: Rename ASSERT => VERIFYAndreas Kling
(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED) Since all of these checks are done in release builds as well, let's rename them to VERIFY to prevent confusion, as everyone is used to assertions being compiled out in release. We can introduce a new ASSERT macro that is specifically for debug checks, but I'm doing this wholesale conversion first since we've accumulated thousands of these already, and it's not immediately obvious which ones are suitable for ASSERT.
2020-12-21AK: Generalize AK::String::to_int() for more typesSahan Fernando
2020-10-06AK: Use StringImpl::operator== in FlyStringAndreas Kling
2020-08-25Kernel: Switch singletons to use new Singleton classTom
MemoryManager cannot use the Singleton class because MemoryManager::initialize is called before the global constructors are run. That caused the Singleton to be re-initialized, causing it to create another MemoryManager instance. Fixes #3226
2020-08-22Revert "Kernel: Move Singleton class to AK"Andreas Kling
This reverts commit f0906250a181c831508a45434b9f645ff98f33e4.
2020-08-22Revert "AK: Get rid of make_singleton function"Andreas Kling
This reverts commit 5a98e329d157a2db8379e0c97c6bdc1328027843.
2020-08-22AK: Get rid of make_singleton functionTom
Just default the InitFunction template argument.
2020-08-22Kernel: Move Singleton class to AKTom
2020-07-21AK: Add case insensitive version of starts_withLuke
2020-06-16AK: Implement a slightly better FlyString::operator==(String)Andreas Kling
This was showing up in Browser profiles, which is silly, so write a new version that doesn't create a temporary String object. There are a whole bunch of these and long-term it would be nice to find a way to share all the very similar logic instead of duplicating it.
2020-06-12AK: Make string-to-number conversion helpers return OptionalAndreas Kling
Get rid of the weird old signature: - int StringType::to_int(bool& ok) const And replace it with sensible new signature: - Optional<int> StringType::to_int() const
2020-05-26AK: Unify FlyString/StringView::ends_with implementation on ↵Brian Gianforcaro
StringUtils::ends_with This creates a unified implementation of ends_with with case sensitivity across String/StringView/FlyString.
2020-05-05AK: Some FlyString improvementsAndreas Kling
We're now clever enough to notice when we're constructing a FlyString from a String that is actually already a FlyString. :^)
2020-04-06AK: Make FlyString a little less hilariously unoptimized :^)Andreas Kling
2020-03-28AK: Add some string comparison operatorsAndreas Kling
Some of these are very inefficient. It's nice to have some optimization opportunities in the future though. :^)
2020-03-23AK: Reduce header dependency graph of String.hAndreas Kling
String.h no longer pulls in StringView.h. We do this by moving a bunch of String functions out-of-line.
2020-03-22AK: Add FlyString::to_lowercase() and LogStream operator<<(FlyString)Andreas Kling
2020-03-22AK: Add FlyString::equals_ignoring_case(StringView)Andreas Kling
And share the code with String by moving the logic to StringUtils. :^)
2020-03-22AK: Add FlyString, a simple flyweight string classAndreas Kling
FlyString is a flyweight string class that wraps a RefPtr<StringImpl> known to be unique among the set of FlyStrings. The class is very unoptimized at the moment. When to use FlyString: - When you want O(1) string comparison - When you want to deduplicate a lot of identical strings When not to use FlyString: - For strings that don't need either of the above features - For strings that are likely to be unique