We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bfeebe5 commit f10ef49Copy full SHA for f10ef49
starlark/src/values/types/set/methods.rs
@@ -291,12 +291,8 @@ pub(crate) fn set_methods(builder: &mut MethodsBuilder) {
291
/// ```
292
fn pop<'v>(this: Value<'v>) -> starlark::Result<Value<'v>> {
293
let mut set = SetMut::from_value(this)?;
294
- let first = set.aref.iter_hashed().next();
295
- match first {
296
- Some(x) => {
297
- set.aref.remove_hashed(x.as_ref());
298
- Ok(x.into_key())
299
- }
+ match set.aref.content.shift_remove_index(0) {
+ Some(x) => Ok(x),
300
None => Err(value_error!("pop from an empty set")),
301
}
302
0 commit comments