Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

def-map-type's predefined count doesn't run in constant time #59

Open
xificurC opened this issue Aug 7, 2019 · 1 comment
Open

def-map-type's predefined count doesn't run in constant time #59

xificurC opened this issue Aug 7, 2019 · 1 comment
Labels

Comments

@xificurC
Copy link

xificurC commented Aug 7, 2019

I think the culprit is here. (counted? (keys {:a 1})) returns false, so this is actually a lie :)

I think you cannot provide a default implementation and should instead force the users to define count themselves.

Right now defining count myself within def-map-type solves the performance issue.

@xificurC xificurC changed the title a map defined with def-map-type says it can be counted in constant time but in fact it can't def-map-type's predefined count doesn't run in constant time Aug 7, 2019
@KingMob
Copy link
Contributor

KingMob commented May 1, 2023

A valid point, but we can't break existing code. Want to submit a PR?

@KingMob KingMob added the bug label May 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants