You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Could you please describe a scenario where it might be a problem? I'm hesitating about changing it as it would be a breaking change of behaviour, the limit behaviour would change for all users of the module and it might break something in tests as well as in production code.
Look at
allowed()
method implementation, https://vscode.dev/github/go-pkgz/lcw/blob/master/v2/expirable_cache.go#L156The
maxKeys
andmaxValueSize
checks use the>=
operator, while themaxKeySize
check uses>
.In
Get()
method, https://vscode.dev/github/go-pkgz/lcw/blob/master/v2/expirable_cache.go#L80 uses>=
operator.This inconsistency could lead to off-by-one errors or unexpected behavior depending on the intended constraint enforcement.
Which comparison operator should be consistently used across all constraint checks?
I can help standardize the comparison operators. Let me know your preference, and I can submit a pull request.
The text was updated successfully, but these errors were encountered: