Accept all negative values, not just -1 #1

Open
wants to merge 1 commit into from

2 participants

@andris9

Hi,

I updated the code to accept any negative value (as it is defined in the Readme), currently only -1 was hardcoded. And in addition to that, I changed the default values to Infinity - it is a number just like any other but always larger than any finite number.

Andris

ps. my code editor trimmed whitespace from the line endings, creating a bit cluttered diff. sorry for that.

@Marak
Owner

I'm curious, does this add any additional functionality?

@andris9

No, it does not. It just allows you to pass any negative value as it is said on the documentation, not just -1

note: a negative value will indicate infinite memory/maxUptime

Setting default value to Infinity does not change the behavior in any way, it is a good value to use since it is always greater than any finite number and thus suits well for the task.

@Marak
Owner

Cool. I usually don't use the Infinity keyword for anything. I'll run some JSperfs for fun and probably merge it in.

Thanks! :-)

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