mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 12:07:45 +00:00
AK+Everywhere: Turn bool keep_empty to an enum in split* functions
This commit is contained in:
parent
f485db2501
commit
3e8b5ac920
44 changed files with 96 additions and 81 deletions
|
@ -65,7 +65,7 @@ UNMAP_AFTER_INIT void CommandLine::add_arguments(Vector<StringView> const& args)
|
|||
continue;
|
||||
}
|
||||
|
||||
auto pair = str.split_view('=', false);
|
||||
auto pair = str.split_view('=');
|
||||
VERIFY(pair.size() == 2 || pair.size() == 1);
|
||||
|
||||
if (pair.size() == 1) {
|
||||
|
|
|
@ -642,7 +642,7 @@ private:
|
|||
TRY(obj.add("hypervisor_vendor_id"sv, info.hypervisor_vendor_id_string()));
|
||||
|
||||
auto features_array = TRY(obj.add_array("features"sv));
|
||||
auto keep_empty = false;
|
||||
auto keep_empty = SplitBehavior::KeepEmpty;
|
||||
|
||||
ErrorOr<void> result; // FIXME: Make this nicer
|
||||
info.features_string().for_each_split_view(' ', keep_empty, [&](StringView feature) {
|
||||
|
|
|
@ -213,7 +213,7 @@ UNMAP_AFTER_INIT Array<unsigned, 3> StorageManagement::extract_boot_device_addre
|
|||
auto parameters_view = m_boot_argument.substring_view(device_prefix.length()).find_first_split_view(';');
|
||||
size_t parts_count = 0;
|
||||
bool parse_failure = false;
|
||||
parameters_view.for_each_split_view(':', false, [&](StringView parameter_view) {
|
||||
parameters_view.for_each_split_view(':', SplitBehavior::Nothing, [&](StringView parameter_view) {
|
||||
if (parse_failure)
|
||||
return;
|
||||
if (parts_count > 2)
|
||||
|
|
|
@ -29,7 +29,7 @@ ErrorOr<FlatPtr> Process::sys$pledge(Userspace<Syscall::SC_pledge_params const*>
|
|||
|
||||
auto parse_pledge = [&](auto pledge_spec, u32& mask) {
|
||||
auto found_invalid_pledge = true;
|
||||
pledge_spec.for_each_split_view(' ', false, [&mask, &found_invalid_pledge](auto const& part) {
|
||||
pledge_spec.for_each_split_view(' ', SplitBehavior::Nothing, [&mask, &found_invalid_pledge](auto const& part) {
|
||||
#define __ENUMERATE_PLEDGE_PROMISE(x) \
|
||||
if (part == #x##sv) { \
|
||||
mask |= (1u << (u32)Pledge::x); \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue