Git Product home page Git Product logo

Comments (2)

Manishearth avatar Manishearth commented on July 18, 2024 1

I am looking into other workarounds in my code; but I think this is a useful property for both hashbrown and the stdlib to try and maintain for the uses of all unsafe code, not just mine. And it's not just useful, it's an easy assumption to make.

Append-only collections are a common pattern and I've seen this kind of logic used outside of elsa as well. I think others will make this assumption in the future; and ideally they would be able to.

I could ask upstream that this property be codified in the docs once we have it settled here.

from hashbrown.

Amanieu avatar Amanieu commented on July 18, 2024

The relevant code is here: https://github.com/rust-lang/hashbrown/blob/3b348eaac93c5ee60f7ce1ff5a246e86782497d1/src/raw/mod.rs#L2277C45-L2277C46

I suppose we could just mark the elements as having a hash value 0 instead of deleting them, however this is a deep implementation detail of the hash table. Consider the future where we replace the standard library hash table implementation yet again. It would not be possible to guarantee that this behavior remains the same.

My recommendation would be to look into a different workaround in your own code.

from hashbrown.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.