allows WaitIO() to reuse the []OpResult slice#19
Open
zjx20 wants to merge 1 commit intoxtaci:masterfrom
Open
Conversation
Owner
|
this makes the interface compatible |
Author
|
是的,不过修复起来也足够简单,加个 nil 就跟原来一样了;要么加一个 WaitIO2() ,一样很恶心;或者就不动了,留一个性能污点。 |
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.
每次调用
WaitIO()都会新创建一个[]OpResult小对象,对性能造成一定影响;这个PR修改了WaitIO()的接口,允许用户传入一个预先分配好的slice,从而避免每次重新创建。甚至用户可以直接重用返回的slice