Skip to content

Commit 3f415d7

Browse files
committed
formatted
1 parent 54bd278 commit 3f415d7

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/mtconnect/device_model/data_item/unit_conversion.cpp

+5-6
Original file line numberDiff line numberDiff line change
@@ -170,24 +170,23 @@ namespace mtconnect::device_model::data_item {
170170
return nullptr;
171171

172172
factor = sscale / tscale;
173-
173+
174174
vector<string> sunits;
175175
boost::split(sunits, source, boost::is_any_of("_"));
176176

177177
vector<string> tunits;
178178
boost::split(tunits, target, boost::is_any_of("_"));
179-
179+
180180
if (sunits.size() == tunits.size())
181181
{
182182
for (auto si = sunits.begin(), ti = tunits.begin();
183-
si != sunits.end() && ti != tunits.end();
184-
si++, ti++)
183+
si != sunits.end() && ti != tunits.end(); si++, ti++)
185184
{
186185
key = *si;
187186
key = key.append("-").append(*ti);
188-
187+
189188
const auto &conversion = m_conversions.find(string(key));
190-
189+
191190
// Check for no support units and not power or factor scaling.
192191
if (conversion == m_conversions.end() && factor == 1.0)
193192
return nullptr;

test_package/unit_conversion_test.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ TEST(UnitConversionTest, check_conversion_from_kw_h_to_watt_second)
142142
auto conv = UnitConversion::make("KILOWATT/HOUR", "WATT/SECOND");
143143
EXPECT_NEAR(0.16666, conv->convert(0.6), 0.001);
144144
EXPECT_NEAR(0.25556, conv->convert(0.92), 0.001);
145-
145+
146146
conv = UnitConversion::make("KILOWATT_HOUR", "WATT_SECOND");
147147
EXPECT_NEAR(2160000.0, conv->convert(0.6), 0.001);
148148
EXPECT_NEAR(3312000.0, conv->convert(0.92), 0.001);

0 commit comments

Comments
 (0)