Coder Social home page Coder Social logo

nicholascross / weakdictionary Goto Github PK

View Code? Open in Web Editor NEW
9.0 2.0 3.0 74 KB

naive (strong key/weak value) dictionary & (weak key/weak value) dictionary implementations in swift

License: MIT License

Objective-C 1.71% Swift 95.98% Ruby 2.31%
swift dictionary weak-reference weak-references

weakdictionary's People

Contributors

nicholascross avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

weakdictionary's Issues

Update podspec swift_version to 5

WeakDictionary appears to convert to Swift 5 fine without any source changes.
However, the podspec says swift_version = '4.2'.

Can we either update the swift_version to 5, or create a Swift-5 branch where the podspec has swift_version set to 5?

I wish there was a way to override the swift_version of a pod from within a Podfile, but sadly there isn't.

Getting a Range from WeakKeyDictionary will never have valuesRetainedByKey

So, this might be intentional, but I just wanted to double-check that it was intended.

This:

return WeakKeyDictionary<Key, Value>(storage: newStorage)

Will end up always having valuesRetainedByKey false, because of this:

private init(storage: WeakDictionary<WeakDictionaryKey<Key, Value>, Value>, valuesRetainedByKey: Bool = false) {

Is this intended? Or should it inherit valuesRetainedByKey from the parent? ☺️

Support reference comparison

Sometimes it is sufficient to do a reference === check when doing a look up. We should support this ability some how as it will perform better in some scenarios.

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.