Age | Commit message (Collapse) | Author |
|
|
|
Using int was a mistake. This patch changes String, StringImpl,
StringView and StringBuilder to use size_t instead of int for lengths.
Obviously a lot of code needs to change as a result of this.
|
|
Previously, MDDocument only split on Unix-style line endings. This adds
a new function to StringView which handles LF, CR and CRLF.
|
|
|
|
|
|
This grabs the hash from the underlying StringImpl if there is one,
otherwise it's computed on the fly.
|
|
Previously we'd implicitly convert the second StringView to a String
when comparing two StringViews, which is obviously not what we wanted.
|
|
This is a shameless copy-paste of String::to_int(). We should find some
way to share this code between String and StringView instead of having
two duplicate copies like this.
|
|
This should make you think twice before trying to use the const char* from
a StringView as if it's a null-terminated string.
|
|
|
|
These two allow making a new substring view starting from,
or starting after, an existing substring view.
Also make use of one of them in the kernel.
|
|
|
|
Without this function, comparing a String to a const char* will instantiate
a temporary String which is obviously not great.
Also add some missing null checks to StringView::operator==(const char*).
|
|
We were comparing past the end of the view, which was clearly not correct.
|
|
String cheaper
... at the cost of an additional pointer per view.
|
|
And tidy up existing view() users.
|
|
Also run it across the whole tree to get everything using the One True Style.
We don't yet run this in an automated fashion as it's a little slow, but
there is a snippet to do so in makeall.sh.
|
|
|
|
|