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

Broken interface #2

Open
cmocanu opened this issue Jul 12, 2018 · 2 comments
Open

Broken interface #2

cmocanu opened this issue Jul 12, 2018 · 2 comments

Comments

@cmocanu
Copy link

cmocanu commented Jul 12, 2018

The interface should expose set, not put, since put doesn't overwrite the keys, which is the entire point of an LRU cache.

Using put causes duplicate keys.

@wizzard0
Copy link
Member

Um, there's a "set" method exposed, isn't it?

@cmocanu
Copy link
Author

cmocanu commented Jul 12, 2018

Not in ILRUCache

export interface ILRUCache {
    put: (key: string, value: any) => void;
    get: (key: string, Entry: boolean) => any;
}

https://github.com/TrueLink/lru-ts/blob/master/index.ts#L24

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

No branches or pull requests

2 participants