-
Notifications
You must be signed in to change notification settings - Fork 910
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: zip arrays together instead of searching
The JSON arrays a and b returned by the two endpoints appear to be parallel in the sense that element a[i] corresponds with element b[i] for all i of interest. Zip these arrays together and iterate over the resulting pairs instead of iterating over one and performing a linear search to find the corresponding element in the other. Additionally: - Check whether we've been bitten by a race condition while requesting the above array data and bail out if so. - Skip the first element of each array because the reported base load is always 0 MW. Refs: #6011, #6050
- Loading branch information
Showing
1 changed file
with
16 additions
and
28 deletions.
There are no files selected for viewing
This file contains 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