Skip to content
Unverified Commit 69287da9 authored by baldurk's avatar baldurk
Browse files

Handle inserting from rdcarray into itself

* This self-insertion has the same kind of problem as overlapping ranges in
  memcpy, the act of inserting items can affect the input range by shifting
  things around. For inserting a single object we just copy it, for inserting a
  range we duplicate the whole array and then do the insert from the old range
  (and destruct it).
* Clearly this is not the most efficient implementation, a better solution would
  be to append onto the existing array (potentially not even reallocating then)
  and doing a rotate/shift in place.
parent 9a3c316f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment