mirror of
https://github.com/CovidBraceletPrj/CovidBracelet.git
synced 2024-12-05 00:55:43 +01:00
SN: Finish impl of sn_get_middle_sn to cover case of older > newer
This commit is contained in:
parent
b96fc5ec50
commit
4f1f5b6eab
@ -21,8 +21,8 @@ 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) {
|
||||
return (older + newer) / 2;
|
||||
return GET_MASKED_SN(((older + newer) / 2));
|
||||
} else {
|
||||
return GET_MASKED_SN(((older + newer + SN_MASK) / 2));
|
||||
}
|
||||
|
||||
// TODO lome: cover case for older > newer
|
||||
}
|
Loading…
Reference in New Issue
Block a user