Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(skiplist): update insert function document #1124

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions crossbeam-skiplist/src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,7 @@ where

/// Inserts an entry with the specified `key` and `value`.
///
/// If `replace` is `true`, then any existing entry with this key will first be removed.
/// If `replace` is `true`, then any existing entry with this key will be removed, using CAS.
fn insert_internal<F, CompareF>(
&self,
key: K,
Expand Down Expand Up @@ -1074,16 +1074,16 @@ where
{
/// Inserts a `key`-`value` pair into the skip list and returns the new entry.
///
/// If there is an existing entry with this key, it will be removed before inserting the new
/// one.
/// If there is an existing entry with this key, it will be removed when inserting the new
/// one using CAS.
pub fn insert(&self, key: K, value: V, guard: &Guard) -> RefEntry<'_, K, V> {
self.insert_internal(key, || value, |_| true, guard)
}

/// Inserts a `key`-`value` pair into the skip list and returns the new entry.
///
/// If there is an existing entry with this key and compare(entry.value) returns true,
/// it will be removed before inserting the new one.
/// it will be removed when inserting the new one. It is atomic when actually replacing data, using CAS.
/// The closure will not be called if the key is not present.
pub fn compare_insert<F>(
&self,
Expand Down
Loading