Simplify hash calculation.
This commit is contained in:
parent
f5ffbfbe06
commit
bed6364dcb
16
src/utils.rs
16
src/utils.rs
@ -122,19 +122,11 @@ fn calc_fn_hash<'a>(
|
|||||||
// We always skip the first module
|
// We always skip the first module
|
||||||
modules.skip(1).for_each(|m| m.hash(s));
|
modules.skip(1).for_each(|m| m.hash(s));
|
||||||
s.write(fn_name.as_bytes());
|
s.write(fn_name.as_bytes());
|
||||||
let num = if let Some(num) = num {
|
if let Some(num) = num {
|
||||||
num
|
|
||||||
} else {
|
|
||||||
let mut count = 0;
|
|
||||||
|
|
||||||
params.for_each(|t| {
|
|
||||||
count += 1;
|
|
||||||
t.hash(s);
|
|
||||||
});
|
|
||||||
|
|
||||||
count
|
|
||||||
};
|
|
||||||
s.write_usize(num);
|
s.write_usize(num);
|
||||||
|
} else {
|
||||||
|
params.for_each(|t| t.hash(s));
|
||||||
|
}
|
||||||
s.finish()
|
s.finish()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user