Code cleanup with regard to PR 414, operator overloads and default constructor for WebRequestMethodComposite#415
Conversation
There was a problem hiding this comment.
Pull request overview
Adds/adjusts WebRequestMethodComposite comparison and move behavior to support method-composite usage across the server and examples.
Changes:
- Updates
WebRequestMethodCompositeoperators and adds explicit copy/move ctor/assignment implementations. - Propagates
std::moveforWebRequestMethodCompositethrough handlersetMethod()calls. - Fixes example sketches to reference
AsyncWebRequestMethod::HTTP_*constants.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/WebServer.cpp | Moves method into handlers when registering routes. |
| src/WebHandlerImpl.h | Moves method into _method in setMethod(). |
| src/ESPAsyncWebServer.h | Alters WebRequestMethodComposite operators; adds copy/move ctors and assignments. |
| src/AsyncJson.h | Moves method into _method in JSON handler setMethod(). |
| examples/HTTPMethodsWithESPIDF/HTTPMethodsWithESPIDF.ino | Updates method enum references to AsyncWebRequestMethod::HTTP_*. |
| examples/HTTPMethodsWithArduino/HTTPMethodsWithArduino.ino | Updates method enum references to AsyncWebRequestMethod::HTTP_*. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
willmmiles
left a comment
There was a problem hiding this comment.
Please avoid redefining the default constructors and operators -- the language builtins are almost always faster.
If the language requires explicit specification use =default to get the benefits of the internally optimized versions.
|
@willmmiles also added 2 commits to fix #414 based on your comment (#414 (comment)) plus another one I saw that already existed. |
No description provided.