Userland: Improve 'ContentDispositionParser' in 'pro'

This patch just applies a suggestion, making the code more readable.
This commit is contained in:
AnotherTest 2020-08-31 18:50:57 +04:30 committed by Andreas Kling
parent 124c52b3b5
commit 861ce62e14
Notes: sideshowbarker 2024-07-19 02:57:30 +09:00

View File

@ -43,7 +43,7 @@ public:
{
GenericLexer lexer(value);
lexer.consume_while([](auto c) { return is_whitespace(c); });
lexer.ignore_while(is_whitespace);
if (lexer.consume_specific("inline")) {
m_kind = Kind::Inline;
@ -55,7 +55,7 @@ public:
if (lexer.consume_specific("attachment")) {
m_kind = Kind::Attachment;
if (lexer.consume_specific(";")) {
lexer.consume_while([](auto c) { return is_whitespace(c); });
lexer.ignore_while(is_whitespace);
if (lexer.consume_specific("filename=")) {
m_filename = lexer.consume_quoted_string();
} else {
@ -68,7 +68,7 @@ public:
if (lexer.consume_specific("form-data")) {
m_kind = Kind::FormData;
while (lexer.consume_specific(";")) {
lexer.consume_while([](auto c) { return is_whitespace(c); });
lexer.ignore_while(is_whitespace);
if (lexer.consume_specific("name=")) {
m_name = lexer.consume_quoted_string();
} else if (lexer.consume_specific("filename=")) {