-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
Description
Currently, the codebase uses commented-out parameter names (e.g., /*context*/
) to indicate unused parameters. This should be replaced with the standard C++17 [[maybe_unused]]
attribute for better code clarity and consistency.
Current Pattern
auto sleep_test(spider::TaskContext& /*context*/, int milliseconds) -> int {
std::this_thread::sleep_for(std::chrono::milliseconds{milliseconds});
return milliseconds;
}
Proposed Pattern
auto sleep_test([[maybe_unused]] spider::TaskContext& context, int milliseconds) -> int {
std::this_thread::sleep_for(std::chrono::milliseconds{milliseconds});
return milliseconds;
}
Benefits
- Uses standard C++17 attribute instead of comments
- Clearer intent and better compiler support
- Consistent with modern C++ practices
- Maintains parameter names for documentation purposes
Scope
Based on initial analysis, this pattern appears throughout the codebase in various test files and implementation files.
References
- C++ maybe_unused attribute documentation
- Related PR: feat: Add job cancellation for early stop of the job execution. #137
- Related comment: feat: Add job cancellation for early stop of the job execution. #137 (comment)
cc: @sitaowang1998
Metadata
Metadata
Assignees
Labels
No labels