mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 14:55:36 +08:00
fixed repeatedly increasing memory usage in units unmarshalling code
This commit is contained in:
@@ -249,14 +249,17 @@ public:
|
|||||||
static const QList<CMeasurementPrefix> &prefixes()
|
static const QList<CMeasurementPrefix> &prefixes()
|
||||||
{
|
{
|
||||||
static QList<CMeasurementPrefix> prefixes;
|
static QList<CMeasurementPrefix> prefixes;
|
||||||
prefixes.append(CMeasurementPrefix::c());
|
if (prefixes.isEmpty())
|
||||||
prefixes.append(CMeasurementPrefix::G());
|
{
|
||||||
prefixes.append(CMeasurementPrefix::h());
|
prefixes.append(CMeasurementPrefix::c());
|
||||||
prefixes.append(CMeasurementPrefix::k());
|
prefixes.append(CMeasurementPrefix::G());
|
||||||
prefixes.append(CMeasurementPrefix::M());
|
prefixes.append(CMeasurementPrefix::h());
|
||||||
prefixes.append(CMeasurementPrefix::m());
|
prefixes.append(CMeasurementPrefix::k());
|
||||||
prefixes.append(CMeasurementPrefix::None());
|
prefixes.append(CMeasurementPrefix::M());
|
||||||
prefixes.append(CMeasurementPrefix::One());
|
prefixes.append(CMeasurementPrefix::m());
|
||||||
|
prefixes.append(CMeasurementPrefix::None());
|
||||||
|
prefixes.append(CMeasurementPrefix::One());
|
||||||
|
}
|
||||||
return prefixes;
|
return prefixes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -140,13 +140,16 @@ public:
|
|||||||
static const QList<CLengthUnit> &units()
|
static const QList<CLengthUnit> &units()
|
||||||
{
|
{
|
||||||
static QList<CLengthUnit> u;
|
static QList<CLengthUnit> u;
|
||||||
u.append(CLengthUnit::cm());
|
if (u.isEmpty())
|
||||||
u.append(CLengthUnit::ft());
|
{
|
||||||
u.append(CLengthUnit::km());
|
u.append(CLengthUnit::cm());
|
||||||
u.append(CLengthUnit::m());
|
u.append(CLengthUnit::ft());
|
||||||
u.append(CLengthUnit::mi());
|
u.append(CLengthUnit::km());
|
||||||
u.append(CLengthUnit::miStatute());
|
u.append(CLengthUnit::m());
|
||||||
u.append(CLengthUnit::NM());
|
u.append(CLengthUnit::mi());
|
||||||
|
u.append(CLengthUnit::miStatute());
|
||||||
|
u.append(CLengthUnit::NM());
|
||||||
|
}
|
||||||
return u;
|
return u;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -277,9 +280,12 @@ public:
|
|||||||
static const QList<CAngleUnit> &units()
|
static const QList<CAngleUnit> &units()
|
||||||
{
|
{
|
||||||
static QList<CAngleUnit> u;
|
static QList<CAngleUnit> u;
|
||||||
u.append(CAngleUnit::deg());
|
if (u.isEmpty())
|
||||||
u.append(CAngleUnit::rad());
|
{
|
||||||
u.append(CAngleUnit::sexagesimalDeg());
|
u.append(CAngleUnit::deg());
|
||||||
|
u.append(CAngleUnit::rad());
|
||||||
|
u.append(CAngleUnit::sexagesimalDeg());
|
||||||
|
}
|
||||||
return u;
|
return u;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -391,10 +397,13 @@ public:
|
|||||||
static const QList<CFrequencyUnit> &units()
|
static const QList<CFrequencyUnit> &units()
|
||||||
{
|
{
|
||||||
static QList<CFrequencyUnit> u;
|
static QList<CFrequencyUnit> u;
|
||||||
u.append(CFrequencyUnit::GHz());
|
if (u.isEmpty())
|
||||||
u.append(CFrequencyUnit::Hz());
|
{
|
||||||
u.append(CFrequencyUnit::kHz());
|
u.append(CFrequencyUnit::GHz());
|
||||||
u.append(CFrequencyUnit::MHz());
|
u.append(CFrequencyUnit::Hz());
|
||||||
|
u.append(CFrequencyUnit::kHz());
|
||||||
|
u.append(CFrequencyUnit::MHz());
|
||||||
|
}
|
||||||
return u;
|
return u;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -510,10 +519,13 @@ public:
|
|||||||
static const QList<CMassUnit> &units()
|
static const QList<CMassUnit> &units()
|
||||||
{
|
{
|
||||||
static QList<CMassUnit> u;
|
static QList<CMassUnit> u;
|
||||||
u.append(CMassUnit::g());
|
if (u.isEmpty())
|
||||||
u.append(CMassUnit::kg());
|
{
|
||||||
u.append(CMassUnit::lb());
|
u.append(CMassUnit::g());
|
||||||
u.append(CMassUnit::t());
|
u.append(CMassUnit::kg());
|
||||||
|
u.append(CMassUnit::lb());
|
||||||
|
u.append(CMassUnit::t());
|
||||||
|
}
|
||||||
return u;
|
return u;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -662,12 +674,15 @@ public:
|
|||||||
static const QList<CPressureUnit> &units()
|
static const QList<CPressureUnit> &units()
|
||||||
{
|
{
|
||||||
static QList<CPressureUnit> u;
|
static QList<CPressureUnit> u;
|
||||||
u.append(CPressureUnit::bar());
|
if (u.isEmpty())
|
||||||
u.append(CPressureUnit::hPa());
|
{
|
||||||
u.append(CPressureUnit::inHg());
|
u.append(CPressureUnit::bar());
|
||||||
u.append(CPressureUnit::inHgFL());
|
u.append(CPressureUnit::hPa());
|
||||||
u.append(CPressureUnit::mbar());
|
u.append(CPressureUnit::inHg());
|
||||||
u.append(CPressureUnit::psi());
|
u.append(CPressureUnit::inHgFL());
|
||||||
|
u.append(CPressureUnit::mbar());
|
||||||
|
u.append(CPressureUnit::psi());
|
||||||
|
}
|
||||||
return u;
|
return u;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -804,9 +819,12 @@ public:
|
|||||||
static const QList<CTemperatureUnit> &units()
|
static const QList<CTemperatureUnit> &units()
|
||||||
{
|
{
|
||||||
static QList<CTemperatureUnit> u;
|
static QList<CTemperatureUnit> u;
|
||||||
u.append(CTemperatureUnit::C());
|
if (u.isEmpty())
|
||||||
u.append(CTemperatureUnit::F());
|
{
|
||||||
u.append(CTemperatureUnit::K());
|
u.append(CTemperatureUnit::C());
|
||||||
|
u.append(CTemperatureUnit::F());
|
||||||
|
u.append(CTemperatureUnit::K());
|
||||||
|
}
|
||||||
return u;
|
return u;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -945,12 +963,15 @@ public:
|
|||||||
static const QList<CSpeedUnit> &units()
|
static const QList<CSpeedUnit> &units()
|
||||||
{
|
{
|
||||||
static QList<CSpeedUnit> u;
|
static QList<CSpeedUnit> u;
|
||||||
u.append(CSpeedUnit::ft_min());
|
if (u.isEmpty())
|
||||||
u.append(CSpeedUnit::ft_s());
|
{
|
||||||
u.append(CSpeedUnit::km_h());
|
u.append(CSpeedUnit::ft_min());
|
||||||
u.append(CSpeedUnit::kts());
|
u.append(CSpeedUnit::ft_s());
|
||||||
u.append(CSpeedUnit::m_s());
|
u.append(CSpeedUnit::km_h());
|
||||||
u.append(CSpeedUnit::NM_h());
|
u.append(CSpeedUnit::kts());
|
||||||
|
u.append(CSpeedUnit::m_s());
|
||||||
|
u.append(CSpeedUnit::NM_h());
|
||||||
|
}
|
||||||
return u;
|
return u;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1078,11 +1099,14 @@ public:
|
|||||||
static const QList<CTimeUnit> &units()
|
static const QList<CTimeUnit> &units()
|
||||||
{
|
{
|
||||||
static QList<CTimeUnit> u;
|
static QList<CTimeUnit> u;
|
||||||
u.append(CTimeUnit::d());
|
if (u.isEmpty())
|
||||||
u.append(CTimeUnit::h());
|
{
|
||||||
u.append(CTimeUnit::min());
|
u.append(CTimeUnit::d());
|
||||||
u.append(CTimeUnit::ms());
|
u.append(CTimeUnit::h());
|
||||||
u.append(CTimeUnit::s());
|
u.append(CTimeUnit::min());
|
||||||
|
u.append(CTimeUnit::ms());
|
||||||
|
u.append(CTimeUnit::s());
|
||||||
|
}
|
||||||
return u;
|
return u;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1179,8 +1203,11 @@ public:
|
|||||||
static const QList<CAccelerationUnit> &units()
|
static const QList<CAccelerationUnit> &units()
|
||||||
{
|
{
|
||||||
static QList<CAccelerationUnit> u;
|
static QList<CAccelerationUnit> u;
|
||||||
u.append(CAccelerationUnit::ft_s2());
|
if (u.isEmpty())
|
||||||
u.append(CAccelerationUnit::m_s2());
|
{
|
||||||
|
u.append(CAccelerationUnit::ft_s2());
|
||||||
|
u.append(CAccelerationUnit::m_s2());
|
||||||
|
}
|
||||||
return u;
|
return u;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user