bug 701: optimize Max (hp, hp)

This commit is contained in:
Andrey Mazo
2009-11-24 10:45:08 +01:00
parent 501e499b8a
commit e4cb79a343
2 changed files with 26 additions and 24 deletions

View File

@@ -38,27 +38,5 @@ HighPrecision Abs (HighPrecision const &value)
return value;
}
}
HighPrecision Max (HighPrecision const &a, HighPrecision const &b)
{
if (a.Compare (b) >= 0)
{
return a;
}
else
{
return b;
}
}
HighPrecision Min (HighPrecision const &a, HighPrecision const &b)
{
if (a.Compare (b) <= 0)
{
return a;
}
else
{
return b;
}
}
}; /* namespace ns3 */

View File

@@ -32,8 +32,32 @@
namespace ns3 {
HighPrecision Abs (HighPrecision const &value);
HighPrecision Max (HighPrecision const &a, HighPrecision const &b);
HighPrecision Min (HighPrecision const &a, HighPrecision const &b);
inline HighPrecision Max (HighPrecision const &a, HighPrecision const &b);
inline HighPrecision Min (HighPrecision const &a, HighPrecision const &b);
inline HighPrecision Max (HighPrecision const &a, HighPrecision const &b)
{
if (a.Compare (b) >= 0)
{
return a;
}
else
{
return b;
}
}
inline HighPrecision Min (HighPrecision const &a, HighPrecision const &b)
{
if (a.Compare (b) <= 0)
{
return a;
}
else
{
return b;
}
}
}; /* namespace ns3 */