-
-
Notifications
You must be signed in to change notification settings - Fork 622
Fix container inefficiency in FlowArrangement.java #415
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3986,9 +3986,8 @@ public void handleClick(int x, int y, PlotRenderingInfo info) { | |
| * | ||
| * @return A list of datasets. | ||
| */ | ||
| private List<XYDataset<S>> getDatasetsMappedToDomainAxis(Integer axisIndex) { | ||
| private List<XYDataset<S>> getDatasetsMappedToDomainAxis(Integer axisIndex, List<XYDataset<S>> result) { | ||
|
||
| Args.nullNotPermitted(axisIndex, "axisIndex"); | ||
| List<XYDataset<S>> result = new ArrayList<>(); | ||
| for (Entry<Integer, XYDataset<S>> entry : this.datasets.entrySet()) { | ||
| int index = entry.getKey(); | ||
| List<Integer> mappedAxes = this.datasetToDomainAxesMap.get(index); | ||
|
|
@@ -4013,9 +4012,8 @@ private List<XYDataset<S>> getDatasetsMappedToDomainAxis(Integer axisIndex) { | |
| * | ||
| * @return A list of datasets. | ||
| */ | ||
| private List<XYDataset<S>> getDatasetsMappedToRangeAxis(Integer axisIndex) { | ||
| private List<XYDataset<S>> getDatasetsMappedToRangeAxis(Integer axisIndex, List<XYDataset<S>> result) { | ||
| Args.nullNotPermitted(axisIndex, "axisIndex"); | ||
| List<XYDataset<S>> result = new ArrayList<>(); | ||
| for (Entry<Integer, XYDataset<S>> entry : this.datasets.entrySet()) { | ||
| int index = entry.getKey(); | ||
| List<Integer> mappedAxes = this.datasetToRangeAxesMap.get(index); | ||
|
|
@@ -4115,7 +4113,7 @@ public Range getDataRange(ValueAxis axis) { | |
| int domainIndex = getDomainAxisIndex(axis); | ||
| if (domainIndex >= 0) { | ||
| isDomainAxis = true; | ||
| mappedDatasets.addAll(getDatasetsMappedToDomainAxis(domainIndex)); | ||
| getDatasetsMappedToDomainAxis(domainIndex, mappedDatasets); | ||
| if (domainIndex == 0) { | ||
| // grab the plot's annotations | ||
| for (XYAnnotation annotation : this.annotations) { | ||
|
|
@@ -4130,7 +4128,7 @@ public Range getDataRange(ValueAxis axis) { | |
| int rangeIndex = getRangeAxisIndex(axis); | ||
| if (rangeIndex >= 0) { | ||
| isDomainAxis = false; | ||
| mappedDatasets.addAll(getDatasetsMappedToRangeAxis(rangeIndex)); | ||
| getDatasetsMappedToRangeAxis(rangeIndex, mappedDatasets); | ||
| if (rangeIndex == 0) { | ||
| for (XYAnnotation annotation : this.annotations) { | ||
| if (annotation instanceof XYAnnotationBoundsInfo) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we not reinitialize
haveItemsInRowtofalsehere?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original code clears the
itemsInRowand adds an element to theitemsInRowafterwards in the same code block.So I think the reinitialization is not required.