The previous implementation of nth was incorrect, it returned the nth
element of the optree but it did not modify the internal state of the
iterator such that future calls to `next()` were after the nth element.
This commit fixes that.
Signed-off-by: Alex Good <alex@memoryandthought.me>
file.
Added the `AMchangeHashes` struct.
Added the `AMchange` and `AMchanges` structs.
Tied the lifetime of an `AMobjId` struct to the `AMresult` struct that
it's returned through so that it can be used to reach equivalent objects
within multiple `AMdoc` structs.
Removed the `AMfreeObjId()` function.
Renamed `AMallocDoc()` to `AMalloc()`.
Added the `AMcommit()` function.
Added the `AMgetChangeHash()` function.
Added the `AMgetChanges()` function.
Added the `AMgetMessage()` function.
Added the `AMlistDelete()` function.
Added the `AMlistPutBool()` function.
Added the `AMmapDelete()` function.
Added the `AMmapPutBool()` function.
Added the `AMobjSizeAt()` function.
Added the `AMsave()` function.
Renamed the `AMvalue::Nothing` variant to `AMvalue::Void`.
Changed all `AMobjId` struct function arguments to be immutable.
Tied the lifetime of an `AMobjId` struct to the `AMresult` struct that
it's returned through so that it can be used to reach equivalent objects
within multiple `AMdoc` structs.
Added test cases for the `AMlistPutBool()` function.
Added a test case for the `AMmapPutBool()` function.
file.
Added the `AMchangeHashes` struct.
Added the `AMchange` and `AMchanges` structs.
Added `ChangeHashes` and `Changes` variants to the `AMresult` struct.
Renamed the `AMvalue::Nothing` variant to `AMvalue::Void`.
Tied the lifetime of an `AMobjId` struct to the `AMresult` struct that
it's returned through so that it can be used to reach equivalent objects
within multiple `AMdoc` structs.
Consolidated the `AMresult` struct's related trait implementations.
The opset iterator was using `OpTreeInternal::get(index)` to fetch each
successive element of the OpSet. This is pretty slow. We make this much
faster by implementing an iterator which is aware of the internal
structure of the OpTree.
This speeds up the save benchmark by about 10%.
Signed-off-by: Alex Good <alex@memoryandthought.me>
The cloning of the op was eating up a significant part of the increment
operation's time. This makes it zero-clone and just extracts the fields
needed.
The docs aren't built with deps so it should be relatively quick to do
without a cache. The cache is also messing with keeping things from
previous versions (e.g. edit-trace).