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 suggest using const MonitorPtr& as opposed to MonitorPtr& in your modified MultiMonitor. You don't need to be concerned with malloc because these are stack variables. Stack is not mallocd on the fly. What is a concern, however, is the overhead for reference counting, which the use of references should avoid.
By using const references, the loop should use constant iterators in the background. That avoids risk of accidental overwrites as well as interaction with any copy-on-write STL weirdness which might lead to the entire list being copied (which also involves tons of reference counting). This is not likely to happen here, but its generally good practice to use const references in foreach loops whenever you don't intend to write.
I'm not sure what the current policy is, but you may want to open pull requests to develop rather than master.
@mirhahn : I've switched those to use const, thanks for the suggestion.
I'm not sure what the policy on develop versus master is either. I'll wait for clarification on that.
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
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.
Similarly to #15