Skip to content
Snippets Groups Projects
Verified Commit 300ead2c authored by Timm Fitschen's avatar Timm Fitschen
Browse files

REVERT: revert unnecessary changes

parent 1e9eaa5c
No related branches found
No related tags found
1 merge request!25F cpp to string
Pipeline #13920 passed
Pipeline: caosdb-cppinttest

#13921

    ......@@ -203,20 +203,21 @@ protected:
    */
    inline auto Remove(int index) -> void {
    this->wrapped->DeleteSubrange(index, 1);
    cache.clear();
    // if (cache.count(index) > 0) {
    // cache.erase(index);
    //}
    //// shift all indices in the cache above index (such that the values do not
    //// get deleted/copied because this could destroy pointers (c-interface).
    // for (int i = index + 1; i < size(); i++) {
    // if (cache.count(i) > 0) {
    // auto handle = cache.extract(i);
    // handle.key()--;
    // cache.insert(std::move(handle));
    //}
    //}
    if (cache.count(index) > 0) {
    cache.erase(index);
    }
    // shift all indices in the cache above index (such that the values do not
    // get deleted/copied because this could destroy pointers (c-interface).
    for (int i = index + 1; i < size(); i++) {
    if (cache.count(i) > 0) {
    auto handle = cache.extract(i);
    handle.key()--;
    cache.insert(std::move(handle));
    }
    }
    // this is possible because cache is an ordered map
    cache.erase(cache.find(size()), cache.end());
    }
    inline auto Clear() noexcept -> void { this->wrapped->Clear(); }
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment