1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:58:11 +00:00

Kernel: Remove CommandLine::get() in favor of lookup()

lookup() returns an Optional<String> which allows us to implement easy
default values using lookup(key).value_or(default_value);
This commit is contained in:
Andreas Kling 2020-04-18 14:22:42 +02:00
parent cebb619f8e
commit e3b450005f
4 changed files with 2 additions and 14 deletions

View file

@ -143,10 +143,7 @@ Vector<HardwareTimer*> TimeManagement::scan_for_non_periodic_timers()
bool TimeManagement::is_hpet_periodic_mode_allowed()
{
if (!kernel_command_line().contains("hpet"))
return true;
auto hpet_mode = kernel_command_line().get("hpet");
auto hpet_mode = kernel_command_line().lookup("hpet").value_or("periodic");
if (hpet_mode == "periodic")
return true;
if (hpet_mode == "nonperiodic")