diff --git a/src/util/SplitString.cxx b/src/util/SplitString.cxx index 821ba1af8..756c6441b 100644 --- a/src/util/SplitString.cxx +++ b/src/util/SplitString.cxx @@ -1,5 +1,5 @@ /* - * Copyright 2013-2020 Max Kellermann + * Copyright 2013-2022 Max Kellermann * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,11 +32,10 @@ #include "StringStrip.hxx" std::forward_list -SplitString(std::string_view _s, char separator, bool strip) noexcept +SplitString(std::string_view s, char separator, bool strip) noexcept { - StringView s(_s); if (strip) - s.StripLeft(); + s = StripLeft(s); std::forward_list list; if (s.empty()) @@ -46,7 +45,7 @@ SplitString(std::string_view _s, char separator, bool strip) noexcept for (auto value : IterableSplitString(s, separator)) { if (strip) - value.Strip(); + value = Strip(value); i = list.emplace_after(i, value); } diff --git a/src/util/SplitString.hxx b/src/util/SplitString.hxx index 8e22ee457..d45764105 100644 --- a/src/util/SplitString.hxx +++ b/src/util/SplitString.hxx @@ -1,5 +1,5 @@ /* - * Copyright 2013-2020 Max Kellermann + * Copyright 2013-2022 Max Kellermann * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -27,8 +27,7 @@ * OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef SPLIT_STRING_HXX -#define SPLIT_STRING_HXX +#pragma once #include #include @@ -45,5 +44,3 @@ */ std::forward_list SplitString(std::string_view s, char separator, bool strip=true) noexcept; - -#endif