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.
想了想, 虽然你直接操作内存会比较高性能, 但是与反复遍历整个大循环想比直接在这里寻找下一个包头会让代码更加清晰, 降低阅读代码时的心智负担, 所以还是提交了这个修改.
你看下是否合适, 如果不合适就还是按照你的方式修改, 还是使用memchr来寻找并再次循环onSearchPacketTail