Conversation
- 禁用拷贝构造函数和赋值运算符,防止双重释放 - 添加移动构造函数和移动赋值运算符 - 使用 constexpr 替代宏定义 DEFAULT_BUFFER_SIZE - 使用 nullptr 替代 NULL - 使用 reinterpret_cast 替代 C 风格转换 - 移除构造函数中重复的 p_buffer_ 初始化 - 添加 <cstring> 头文件 - 添加 hasRemaining() const 修饰符
e263615 to
b98c200
Compare
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
修复内容
根据 code review 的结果,修复了以下问题:
严重问题
代码现代化改进
constexpr替代宏定义DEFAULT_BUFFER_SIZEnullptr替代NULLstatic_cast替代 C 风格转换p_buffer_初始化<cstring>头文件hasRemaining()const 修饰符测试
所有现有测试保持不变,CI 将验证更改的正确性。