-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use arrays to initialize the member variables of MultilevelSplitQueue #14139
Conversation
5265694
to
4b396c4
Compare
@tangjiangling Can you rebase to make sure CI results are fresh and I can merge this then. |
Previously in `MultilevelSplitQueue`, `levelScheduledTime` and `levelMinPriority` were initialized using arrays, while `levelWaitingSplits` and `selectedLevelCounters` were initialized using `List`, this commit unifies the style by making all these variables initialized using array style.
The indexes of these arrays are all "level" related, so we can rename them.
4b396c4
to
52e148d
Compare
Rebased from master. |
Unless there’s a compelling reason to use arrays (measurable performance improvements, memory, etc), we should be using lists. |
In this specific case there's no benefit to using lists as far as I can tell. And note that all other code there already uses arrays. I think this change brings some consistency without any additional cost. |
Agreed, we have only a small number of elements (5):
The main purpose of this PR is to unify the types of variables, so if I understand you correctly, you agree that I unify them into lists, right? @martint |
Unifying them makes sense (either to lists or arrays, as appropriate). I'd like to understand why they are different, though (it may require going through the history of changes) |
Following your suggestion, I have checked the change history: d743fb0 introduces the following 3 variables:
c05e081 introduces the following 1 variable:
From the change history, I think there is no special reason to choose list or array, maybe just the author's development style at that time So I'll keep this PR as it is, and you can double-check to see if I'm missing something. |
@martint This is ok to merge, correct? EDIT: I assume yes by your reaction to the previous comment. Merging, feel free to do a post-merge review if needed. |
Previously in
MultilevelSplitQueue
,levelScheduledTime
andlevelMinPriority
were initialized using arrays, whilelevelWaitingSplits
andselectedLevelCounters
were initialized usingList
, this commit unifies the style by making all these variablesinitialized using array style.
Release notes
(x) This is not user-visible and no release notes are required.