mirror of
https://github.com/CovidBraceletPrj/CovidBracelet.git
synced 2024-12-05 00:55:43 +01:00
Update src/ens/sequencenumber.c
Support equal values of older and newer
This commit is contained in:
parent
bb6be05d53
commit
a87c8928c2
@ -20,9 +20,9 @@ record_sequence_number_t sn_increment_by(record_sequence_number_t sn, uint32_t a
|
||||
}
|
||||
|
||||
record_sequence_number_t sn_get_middle_sn(record_sequence_number_t older, record_sequence_number_t newer) {
|
||||
if (older < newer) {
|
||||
if (older <= newer) {
|
||||
return GET_MASKED_SN(((older + newer) / 2));
|
||||
} else {
|
||||
return GET_MASKED_SN(((older + newer + SN_MASK) / 2));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user