Skip to content

Commit be11d78

Browse files
fphammerleWanzenBug
authored andcommitted
fix clang-tidy warning modernize-use-emplace
1 parent 9e0bb81 commit be11d78

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

.clang-tidy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ WarningsAsErrors: >-
1919
-cppcoreguidelines-pro-type-member-init,
2020
-cppcoreguidelines-pro-type-vararg,
2121
-cppcoreguidelines-special-member-functions,
22-
-modernize-use-emplace,
2322
-modernize-use-equals-delete,
2423
-modernize-use-noexcept,
2524
-performance-inefficient-vector-operation,

examples/ReadingSData.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ int main() {
3333
std::vector<int32> dims = item.getDims();
3434
for (const auto &dim : dims) {
3535
if (dim >= 1) {
36-
ranges.push_back(Range(0, dim - 1));
36+
ranges.emplace_back(0, dim - 1);
3737
} else {
38-
ranges.push_back(Range(0, dim));
38+
ranges.emplace_back(0, dim);
3939
}
4040
}
4141
item.read(vec, ranges);

lib/HdfFile.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ hdf4cpp::HdfFile::HdfFile(const std::string &path)
3131
std::vector<int32> refs((size_t)loneSize);
3232
Vlone(vId, refs.data(), loneSize);
3333
for (const auto &ref : refs) {
34-
loneRefs.push_back(std::pair<int32, Type>(ref, VGROUP));
34+
loneRefs.emplace_back(ref, VGROUP);
3535
}
3636

3737
int32 loneVdata = VSlone(vId, nullptr, 0);
3838
refs.resize((size_t)loneVdata);
3939
VSlone(vId, refs.data(), loneVdata);
4040
for (const auto &ref : refs) {
41-
loneRefs.push_back(std::pair<int32, Type>(ref, VDATA));
41+
loneRefs.emplace_back(ref, VDATA);
4242
}
4343
}
4444
hdf4cpp::HdfFile::HdfFile(HdfFile &&file)

0 commit comments

Comments
 (0)