Skip to content

Conversation

@wvpm
Copy link
Contributor

@wvpm wvpm commented Oct 13, 2025

#545 added tracking balance history per country.
Also price history is tracked since #288

They used ValueHistory which is flawed in several ways:

  • it has a static size so you don't know how many periods of history it has (required for UI).
  • it requires filling with a single value (0 isn't practical when you need to find a min and max, since 0 could be a normal value and thus can't be used to identify empty values)
  • it uses a vector instead of array despite having a compile-time constant capacity available
  • it's implementation deviates from the industry standard circular buffer or ring buffer

For these reasons, I let Gemini write a simple CircularBuffer with support for iterating and filling with a single value.

@wvpm wvpm added enhancement New feature or request topic:core labels Oct 13, 2025
@wvpm wvpm added this to the 0.9.0 milestone Oct 13, 2025
@wvpm wvpm enabled auto-merge October 13, 2025 15:18
@Spartan322
Copy link
Member

Spartan322 commented Oct 13, 2025

#428 already contains a ring buffer.

@Spartan322
Copy link
Member

The CircularBuffer is superseded by #575, use foonathan::memory to achieve stack allocation.

@wvpm wvpm closed this Oct 16, 2025
auto-merge was automatically disabled October 16, 2025 13:18

Pull request was closed

@wvpm wvpm force-pushed the circular_buffer_instead_of_valuehistory branch from bb22f7d to 82ba102 Compare October 16, 2025 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request topic:core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants