Skip to content

Conversation

@alessandro1105
Copy link

i've used this library on my project and it worked successfully.

@AlexanderBrevig
Copy link
Member

Hi Alessandro! Thank you for your contribution :)

I've adopted it to meet Wiring 'standards' and removed the #include Arduino.h and fixed a destructor bug.

Could you do me a favor and try this version with your project?
Copy HashMap.h from here https://github.com/AlexanderBrevig/Wiring/tree/master/framework/libraries/HashMap
put(hash, value) now also overwrite the hashmap for an existing hash, demonstrated in the new HelloHashMap sketch that is included in the linked version.

The minor changes to the API is as follows (may not be a complete list):
length() -> count()
getValue() -> valueFor(hash), valueAt(index) and value()
getKey() -> keyFor(value), keyAt(index), and key()

Hope to hear from you soon! Let me know if you want another for of attribution in the HashMap.h file

Best regards,
/Alexander

@alessandro1105
Copy link
Author

Hi !
At the moment i can't try the new version of the library. I will test is as soon as possible.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants