mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-29 14:14:45 +03:00
Userland: Improve 'ContentDispositionParser' in 'pro'
This patch just applies a suggestion, making the code more readable.
This commit is contained in:
parent
124c52b3b5
commit
861ce62e14
Notes:
sideshowbarker
2024-07-19 02:57:30 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/861ce62e146 Pull-request: https://github.com/SerenityOS/serenity/pull/3368
@ -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=")) {
|
||||
|
Loading…
Reference in New Issue
Block a user