Skip to content

Commit 25cb968

Browse files
committed
Changing to inline function
1 parent 5051f80 commit 25cb968

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/WebRequest.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include "literals.h"
88
#include <cstring>
99

10-
#define __is_param_char(c) ((c) && ((c) != '{') && ((c) != '[') && ((c) != '&') && ((c) != '='))
10+
static inline bool isParamChar(char c) { return ((c) && ((c) != '{') && ((c) != '[') && ((c) != '&') && ((c) != '=')); }
1111

1212
static void doNotDelete(AsyncWebServerRequest *) {}
1313

@@ -183,12 +183,12 @@ void AsyncWebServerRequest::_onData(void *buf, size_t len) {
183183
if (_parsedLength == 0) {
184184
if (_contentType.startsWith(T_app_xform_urlencoded)) {
185185
_isPlainPost = true;
186-
} else if (_contentType == T_text_plain && __is_param_char(((char *)buf)[0])) {
186+
} else if (_contentType == T_text_plain && isParamChar(((char *)buf)[0])) {
187187
size_t i = 0;
188188
char ch;
189189
do {
190190
ch = ((char *)buf)[i];
191-
} while (i++ < len && __is_param_char(ch));
191+
} while (i++ < len && isParamChar(ch));
192192
if (i < len && ((char *)buf)[i - 1] == '=') {
193193
_isPlainPost = true;
194194
}

0 commit comments

Comments
 (0)