mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
13265ad636
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/43679 The current implementation of clear-with-predicate first copies unconsumed elements and then all others. This works correctly when the buffer is full (wraps around), but fails if size() < maxSize: add() may no longer insert an element in the correct position (after the last unconsumed entry; see new unit test). Replace it with a loop that iterates over all entries in order, and adjusts cursorStart and cursorEnd to point to the last numToConsume elements of the vector. Changelog: [Internal] Reviewed By: rshest Differential Revision: D55273402 fbshipit-source-id: 647dc35faeb35c7fa99b8113cf85ce7f02f073e5