diff options
Diffstat (limited to 'Applications/Terminal/Terminal.cpp')
-rw-r--r-- | Applications/Terminal/Terminal.cpp | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/Applications/Terminal/Terminal.cpp b/Applications/Terminal/Terminal.cpp index 3e628deb8d..8c68c4e241 100644 --- a/Applications/Terminal/Terminal.cpp +++ b/Applications/Terminal/Terminal.cpp @@ -116,21 +116,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; -} - static inline Color lookup_color(unsigned color) { return Color::from_rgb(xterm_colors[color]); @@ -397,7 +382,7 @@ void Terminal::execute_xterm_command() { m_final = '@'; bool ok; - unsigned value = parse_uint(String::copy(m_xterm_param1), ok); + unsigned value = String::copy(m_xterm_param1).to_uint(ok); if (ok) { switch (value) { case 0: @@ -421,7 +406,7 @@ void Terminal::execute_escape_sequence(byte final) ParamVector params; for (auto& parampart : paramparts) { bool ok; - unsigned value = parse_uint(parampart, ok); + unsigned value = parampart.to_uint(ok); if (!ok) { m_parameters.clear_with_capacity(); m_intermediates.clear_with_capacity(); |