1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 05:08:13 +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

@ -216,10 +216,7 @@ void init_stage2()
bool text_debug = kernel_command_line().contains("text_debug");
bool force_pio = kernel_command_line().contains("force_pio");
auto root = kernel_command_line().get("root");
if (root.is_empty()) {
root = "/dev/hda";
}
auto root = kernel_command_line().lookup("root").value_or("/dev/hda");
if (!root.starts_with("/dev/hda")) {
klog() << "init_stage2: root filesystem must be on the first IDE hard drive (/dev/hda)";