You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to suggest a small change in the GetBranchesContainingCommit yielding function. Its current form makes it fully "asynchronous" causing the exception to be thrown only when the collection will be iterated. That's currently not a problem in the codebase because all call sites are doing direct iteration but this could cause some issue in the future if new call sites are added without respecting this condition.
Detailed Description
Please use the following Sharplab repro to see the problem live.
Context
As said in the description, there is no direct problem but this is an issue to become if people are unaware of this behavior and so do not respect the condition use.
Possible Implementation
The sharplab link contains a suggestion of implementation (with a local function), the name has to be defined. I usually go for Iterator, Impl or function name + suffix (e.g. XXXIterator or XXXImpl). It's also probably worth adding a comment to explain the reasoning of the split.
The text was updated successfully, but these errors were encountered:
I would like to suggest a small change in the GetBranchesContainingCommit yielding function. Its current form makes it fully "asynchronous" causing the exception to be thrown only when the collection will be iterated. That's currently not a problem in the codebase because all call sites are doing direct iteration but this could cause some issue in the future if new call sites are added without respecting this condition.
Detailed Description
Please use the following Sharplab repro to see the problem live.
Context
As said in the description, there is no direct problem but this is an issue to become if people are unaware of this behavior and so do not respect the condition use.
Possible Implementation
The sharplab link contains a suggestion of implementation (with a local function), the name has to be defined. I usually go for
Iterator
,Impl
or function name + suffix (e.g.XXXIterator
orXXXImpl
). It's also probably worth adding a comment to explain the reasoning of the split.The text was updated successfully, but these errors were encountered: