constref more things

Thanks @ridiculousfish!
This commit is contained in:
Fabian Homborg 2018-01-08 10:52:29 +01:00
parent 4dc1c6ca39
commit b2b4ab4bab

View file

@ -804,7 +804,7 @@ wcstring reformat_for_screen(const wcstring &msg) {
}
/// Escape a string in a fashion suitable for using as a URL. Store the result in out_str.
static void escape_string_url(wcstring in, wcstring &out) {
static void escape_string_url(const wcstring &in, wcstring &out) {
for (auto& c1 : in) {
// This silliness is so we get the correct result whether chars are signed or unsigned.
unsigned int c2 = (unsigned int)c1 & 0xFF;
@ -854,7 +854,7 @@ static bool unescape_string_url(const wchar_t *in, wcstring *out) {
}
/// Escape a string in a fashion suitable for using as a fish var name. Store the result in out_str.
static void escape_string_var(const wcstring in, wcstring &out) {
static void escape_string_var(const wcstring &in, wcstring &out) {
bool prev_was_hex_encoded = false;
for (auto c1 : in) {
// This silliness is so we get the correct result whether chars are signed or unsigned.