Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: isaacs/node-lru-cache
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v7.18.1
Choose a base ref
...
head repository: isaacs/node-lru-cache
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v7.18.3
Choose a head ref
  • 4 commits
  • 7 files changed
  • 1 contributor

Commits on Mar 5, 2023

  1. Fix infinite loop in rindexes with maxless data

    Verify that index is not undefined in isValidIndex()
    
    Fixes a bug introduced in c29079d, when support for non-preallocated
    data bound by ttl and/or maxSize was added.  When the pointer array is a
    `number[]` instead of a `UintArray`, unset values will be `undefined`
    rather than `0`, resulting in the situation where `index ===
    this.keyMap.get(this.keyList[index])` is not a valid test for index
    validity, since it can be `undefined` rather than always being
    guaranteed to be a number.
    
    Another way to fix this would be ensure that a previously unused spot in
    the array is initialized to `0` when pointers are initialized.  However,
    in performance critical cases, every set and get matters, and relying on
    the initialized state of a UintArray saves that check in several hot
    paths.  On the other hand, the test for `index === undefined` only has
    to happen during iteration, which is much less likely to be performance
    critical.
    
    Fix: #278
    isaacs committed Mar 5, 2023
    Configuration menu
    Copy the full SHA
    d5f0fde View commit details
    Browse the repository at this point in the history
  2. 7.18.2

    isaacs committed Mar 5, 2023
    Configuration menu
    Copy the full SHA
    c4f4705 View commit details
    Browse the repository at this point in the history
  3. Do not expose background fetches in forEach

    Also, fixes a variant of #278, which would not cause infinite recursion,
    but could allow the forEach method to be called with undefined key/value
    in some cases.
    isaacs committed Mar 5, 2023
    Configuration menu
    Copy the full SHA
    a3027ed View commit details
    Browse the repository at this point in the history
  4. 7.18.3

    isaacs committed Mar 5, 2023
    Configuration menu
    Copy the full SHA
    7a6f529 View commit details
    Browse the repository at this point in the history
Loading