mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-07 16:28:38 +09:00
Issue #2323 - Part 1: Add Min()/Max() methods to TimeDuration.
Just some helper functions to make time comparisons in the correct data format easier. See BZ 1321885
This commit is contained in:
parent
e0e1542913
commit
c78ecee3f2
1 changed files with 12 additions and 0 deletions
|
|
@ -7,6 +7,7 @@
|
|||
#define mozilla_TimeStamp_h
|
||||
|
||||
#include <stdint.h>
|
||||
#include <algorithm> // for std::min, std::max
|
||||
#include "mozilla/Assertions.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/FloatingPoint.h"
|
||||
|
|
@ -173,6 +174,17 @@ public:
|
|||
|
||||
return FromTicks(ticks);
|
||||
}
|
||||
static BaseTimeDuration Max(const BaseTimeDuration& aA,
|
||||
const BaseTimeDuration& aB)
|
||||
{
|
||||
return FromTicks(std::max(aA.mValue, aB.mValue));
|
||||
}
|
||||
static BaseTimeDuration Min(const BaseTimeDuration& aA,
|
||||
const BaseTimeDuration& aB)
|
||||
{
|
||||
return FromTicks(std::min(aA.mValue, aB.mValue));
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
// Block double multiplier (slower, imprecise if long duration) - Bug 853398.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue