8000 Release v0.0.3635: [BREAKING] ae.utils.rangeassoc: Re-implement using a RedBlackTree · CyberShadow/ae · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

v0.0.3635

New major iteration of IntervalAssocArray:

- A RedBlackTree is now used to store the spans

- Slicing is now O(1) (use .dup to get a shallow copy instead)

- "scan" is no longer necessary, just use foreach over a slice

- "update" is no longer necessary, just use foreach with ref

Rationale:

- Initial version was a placeholder, using a very basic data
  internal structure and algorithms.

  As expected, this led to poor performance in real-world use cases.

- The "scan" and "update" methods were a suboptimal interface,
  which did not follow any established D conventions.

Changes required:

- Replace "scan" calls with foreach loops over a slice of the array

- Replace "update" calls with foreach loops which modify the value
  with "ref"

- Replace slicing (when used to get a shallow copy) with "dup"

See unit test changes for examples.
Assets 2
Loading
0