diff options
| author | Utkarsh Saxena <usx@google.com> | 2025-09-25 17:50:45 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-25 17:50:45 +0200 |
| commit | f2c268f9370e0021ae373d919ba2283eb851527f (patch) | |
| tree | 73b6827991a0702f23e33c381002ad0a54c7c09a /libcxx/include/__algorithm/rotate.h | |
| parent | b5c01029eddea97b86af80c75d8ad60be67bd546 (diff) | |
| download | llvm-f2c268f9370e0021ae373d919ba2283eb851527f.zip llvm-f2c268f9370e0021ae373d919ba2283eb851527f.tar.gz llvm-f2c268f9370e0021ae373d919ba2283eb851527f.tar.bz2 | |
[ImmutableSet] Optimize add/remove operations to avoid redundant tree modifications (#159845)
Optimize ImmutableSet operations to avoid unnecessary tree modifications
when adding existing elements or removing non-existent elements.
- Modified `ImutAVLFactory::add_internal()` to return the original tree
when both key and value are the same, avoiding unnecessary node creation
- Updated `ImutAVLFactory::remove_internal()` and `add_internal()` to
return the original tree when no changes are made.
Note that `balanceTree` always end up creating at least one node even
when no rebalancing is done. So we also need to avoid unnecessary calls
to it.
Diffstat (limited to 'libcxx/include/__algorithm/rotate.h')
0 files changed, 0 insertions, 0 deletions
