diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-05-08 19:21:51 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-05-08 19:21:51 +0200 |
commit | b5b44a29bbfbf83e348ab0007d04039fb252bbe5 (patch) | |
tree | 4138c5d79961cf8d5582bdb46ca712ac1f246b9b /Kernel/TTY/VirtualConsole.cpp | |
parent | cea631d90c4808b3d161fa25bbf09af65a72ef62 (diff) | |
download | serenity-b5b44a29bbfbf83e348ab0007d04039fb252bbe5.zip |
Replace various copies of parse_uint(String) with String::to_uint().
Diffstat (limited to 'Kernel/TTY/VirtualConsole.cpp')
-rw-r--r-- | Kernel/TTY/VirtualConsole.cpp | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/Kernel/TTY/VirtualConsole.cpp b/Kernel/TTY/VirtualConsole.cpp index 5c48276b7e..c4e3f9eb1a 100644 --- a/Kernel/TTY/VirtualConsole.cpp +++ b/Kernel/TTY/VirtualConsole.cpp @@ -128,21 +128,6 @@ inline bool is_valid_final_character(byte ch) return ch >= 0x40 && ch <= 0x7e; } -unsigned parse_uint(const String& str, bool& ok) -{ - unsigned value = 0; - for (int i = 0; i < str.length(); ++i) { - if (str[i] < '0' || str[i] > '9') { - ok = false; - return 0; - } - value = value * 10; - value += str[i] - '0'; - } - ok = true; - return value; -} - enum class VGAColor : byte { Black = 0, Blue, @@ -324,7 +309,7 @@ void VirtualConsole::execute_escape_sequence(byte final) Vector<unsigned> params; for (auto& parampart : paramparts) { bool ok; - unsigned value = parse_uint(parampart, ok); + unsigned value = parampart.to_uint(ok); if (!ok) { // FIXME: Should we do something else? return; |