Add switch expression.
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
use crate::fn_native::{FnPtr, SendSync};
|
||||
use crate::r#unsafe::{unsafe_cast_box, unsafe_try_cast};
|
||||
use crate::utils::ImmutableString;
|
||||
use crate::INT;
|
||||
use crate::{StaticVec, INT};
|
||||
|
||||
#[cfg(not(feature = "no_closure"))]
|
||||
use crate::fn_native::{shared_try_take, Locked, Shared};
|
||||
@@ -378,10 +378,15 @@ impl Hash for Dynamic {
|
||||
#[cfg(not(feature = "no_index"))]
|
||||
Union::Array(a) => a.hash(state),
|
||||
#[cfg(not(feature = "no_object"))]
|
||||
Union::Map(m) => m.iter().for_each(|(key, item)| {
|
||||
key.hash(state);
|
||||
item.hash(state);
|
||||
}),
|
||||
Union::Map(m) => {
|
||||
let mut buf: StaticVec<_> = m.keys().collect();
|
||||
buf.sort();
|
||||
|
||||
buf.into_iter().for_each(|key| {
|
||||
key.hash(state);
|
||||
m[key].hash(state);
|
||||
})
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "no_closure"))]
|
||||
#[cfg(not(feature = "sync"))]
|
||||
|
Reference in New Issue
Block a user