Skip to content

Commit bcac5f3

Browse files
committed
[CORE] apply code-format
1 parent 8d173f8 commit bcac5f3

File tree

24 files changed

+421
-273
lines changed

24 files changed

+421
-273
lines changed

DataFormats/Common/interface/AssociationVector.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,13 +157,13 @@ namespace edm {
157157

158158
template <typename KeyRefProd, typename CVal, typename KeyRef, typename SizeType, typename KeyReferenceHelper>
159159
inline typename AssociationVector<KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper>::const_reference
160-
AssociationVector<KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper>::operator[](size_type n) const {
160+
AssociationVector<KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper>::operator[](size_type n) const {
161161
return transientVector()[n];
162162
}
163163

164164
template <typename KeyRefProd, typename CVal, typename KeyRef, typename SizeType, typename KeyReferenceHelper>
165165
inline typename CVal::const_reference
166-
AssociationVector<KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper>::operator[](KeyRef const& k) const {
166+
AssociationVector<KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper>::operator[](KeyRef const& k) const {
167167
KeyRef keyRef = KeyReferenceHelper::get(k, ref_.id());
168168
checkForWrongProduct(keyRef.id(), ref_.id());
169169
return data_[keyRef.key()];
@@ -172,7 +172,7 @@ namespace edm {
172172
template <typename KeyRefProd, typename CVal, typename KeyRef, typename SizeType, typename KeyReferenceHelper>
173173
template <typename K>
174174
inline typename CVal::const_reference
175-
AssociationVector<KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper>::operator[](edm::Ptr<K> const& k) const {
175+
AssociationVector<KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper>::operator[](edm::Ptr<K> const& k) const {
176176
static_assert(std::is_base_of<K, key_type>::value,
177177
"edm::Ptr's key type is not a base class of AssociationVector's item type");
178178
checkForWrongProduct(k.id(), ref_.id());

DataFormats/Common/interface/ConvertHandle.h

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,27 +20,30 @@ namespace edm {
2020
// Convert from handle-to-void to handle-to-T
2121
template <typename T>
2222
Handle<T> convert_handle(BasicHandle&& bh) noexcept(true) {
23-
if
24-
UNLIKELY(bh.failedToGet()) { return Handle<T>(std::move(bh.whyFailedFactory())); }
23+
if UNLIKELY (bh.failedToGet()) {
24+
return Handle<T>(std::move(bh.whyFailedFactory()));
25+
}
2526
void const* basicWrapper = bh.wrapper();
26-
if
27-
UNLIKELY(nullptr == basicWrapper) { return Handle<T>{handleimpl::makeInvalidReferenceException()}; }
27+
if UNLIKELY (nullptr == basicWrapper) {
28+
return Handle<T>{handleimpl::makeInvalidReferenceException()};
29+
}
2830
auto wrapper = static_cast<Wrapper<T> const*>(basicWrapper);
2931

3032
return Handle<T>(wrapper->product(), bh.provenance());
3133
}
3234

3335
template <typename T>
3436
Handle<T> convert_handle_check_type(BasicHandle&& bh) {
35-
if
36-
UNLIKELY(bh.failedToGet()) { return Handle<T>(std::move(bh.whyFailedFactory())); }
37+
if UNLIKELY (bh.failedToGet()) {
38+
return Handle<T>(std::move(bh.whyFailedFactory()));
39+
}
3740
void const* basicWrapper = bh.wrapper();
38-
if
39-
UNLIKELY(basicWrapper == nullptr) { return Handle<T>{handleimpl::makeInvalidReferenceException()}; }
40-
if
41-
UNLIKELY(!(bh.wrapper()->dynamicTypeInfo() == typeid(T))) {
42-
handleimpl::throwConvertTypeError(typeid(T), bh.wrapper()->dynamicTypeInfo());
43-
}
41+
if UNLIKELY (basicWrapper == nullptr) {
42+
return Handle<T>{handleimpl::makeInvalidReferenceException()};
43+
}
44+
if UNLIKELY (!(bh.wrapper()->dynamicTypeInfo() == typeid(T))) {
45+
handleimpl::throwConvertTypeError(typeid(T), bh.wrapper()->dynamicTypeInfo());
46+
}
4447
Wrapper<T> const* wrapper = static_cast<Wrapper<T> const*>(basicWrapper);
4548

4649
return Handle<T>(wrapper->product(), bh.provenance());

DataFormats/Provenance/interface/BranchKey.h

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,14 @@ namespace edm {
3636
};
3737

3838
inline bool operator<(BranchKey const& a, BranchKey const& b) {
39-
return a.friendlyClassName() < b.friendlyClassName()
40-
? true
41-
: a.friendlyClassName() > b.friendlyClassName()
42-
? false
43-
: a.moduleLabel() < b.moduleLabel()
44-
? true
45-
: a.moduleLabel() > b.moduleLabel()
46-
? false
47-
: a.productInstanceName() < b.productInstanceName()
48-
? true
49-
: a.productInstanceName() > b.productInstanceName()
50-
? false
51-
: a.processName() < b.processName() ? true : false;
39+
return a.friendlyClassName() < b.friendlyClassName() ? true
40+
: a.friendlyClassName() > b.friendlyClassName() ? false
41+
: a.moduleLabel() < b.moduleLabel() ? true
42+
: a.moduleLabel() > b.moduleLabel() ? false
43+
: a.productInstanceName() < b.productInstanceName() ? true
44+
: a.productInstanceName() > b.productInstanceName() ? false
45+
: a.processName() < b.processName() ? true
46+
: false;
5247
}
5348

5449
inline bool operator==(BranchKey const& a, BranchKey const& b) { return !(a < b || b < a); }

FWCore/FWLite/bin/storageSizeForBranch.cc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,11 @@ int main(int argc, char* argv[]) try {
4545
"file"
4646
"\nAllowed options";
4747
boost::program_options::options_description desc(descString);
48-
desc.add_options()(kHelpCommandOpt, "show this help message")(kEntryNumberCommandOpt,
49-
boost::program_options::value<int>(),
50-
"read branch from the given entry value (default 0)")(
51-
kBranchNameOpt, "name of branch")(kFileNameOpt, "name of file");
48+
desc.add_options()(kHelpCommandOpt, "show this help message")(
49+
kEntryNumberCommandOpt,
50+
boost::program_options::value<int>(),
51+
"read branch from the given entry value (default 0)")(kBranchNameOpt, "name of branch")(kFileNameOpt,
52+
"name of file");
5253

5354
boost::program_options::positional_options_description p;
5455
p.add(kBranchNameOpt, 1);

FWCore/Framework/bin/cmsRun.cpp

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -152,20 +152,24 @@ int main(int argc, char* argv[]) {
152152
boost::program_options::options_description desc(descString);
153153

154154
desc.add_options()(kHelpCommandOpt, "produce help message")(
155-
kParameterSetCommandOpt, boost::program_options::value<std::string>(), "configuration file")(
156-
kJobreportCommandOpt,
155+
kParameterSetCommandOpt,
157156
boost::program_options::value<std::string>(),
158-
"file name to use for a job report file: default extension is .xml")(
159-
kEnableJobreportCommandOpt, "enable job report files (if any) specified in configuration file")(
160-
kJobModeCommandOpt,
161-
boost::program_options::value<std::string>(),
162-
"Job Mode for MessageLogger defaults - default mode is grid")(
163-
kNumberOfThreadsCommandOpt,
164-
boost::program_options::value<unsigned int>(),
165-
"Number of threads to use in job (0 is use all CPUs)")(
166-
kSizeOfStackForThreadCommandOpt,
167-
boost::program_options::value<unsigned int>(),
168-
"Size of stack in KB to use for extra threads (0 is use system default size)")(kStrictOpt, "strict parsing");
157+
"configuration file")(kJobreportCommandOpt,
158+
boost::program_options::value<std::string>(),
159+
"file name to use for a job report file: default extension is "
160+
".xml")(kEnableJobreportCommandOpt,
161+
"enable job report files (if any) specified in configuration "
162+
"file")(kJobModeCommandOpt,
163+
boost::program_options::value<std::string>(),
164+
"Job Mode for MessageLogger defaults - default mode is "
165+
"grid")(kNumberOfThreadsCommandOpt,
166+
boost::program_options::value<unsigned int>(),
167+
"Number of threads to use in job (0 is use all "
168+
"CPUs)")(kSizeOfStackForThreadCommandOpt,
169+
boost::program_options::value<unsigned int>(),
170+
"Size of stack in KB to use for extra threads (0 is "
171+
"use system default size)")(kStrictOpt,
172+
"strict parsing");
169173

170174
// anything at the end will be ignored, and sent to python
171175
boost::program_options::positional_options_description p;

FWCore/Framework/bin/cmsRunPython3.cpp

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -151,20 +151,24 @@ int main(int argc, char* argv[]) {
151151
boost::program_options::options_description desc(descString);
152152

153153
desc.add_options()(kHelpCommandOpt, "produce help message")(
154-
kParameterSetCommandOpt, boost::program_options::value<std::string>(), "configuration file")(
155-
kJobreportCommandOpt,
154+
kParameterSetCommandOpt,
156155
boost::program_options::value<std::string>(),
157-
"file name to use for a job report file: default extension is .xml")(
158-
kEnableJobreportCommandOpt, "enable job report files (if any) specified in configuration file")(
159-
kJobModeCommandOpt,
160-
boost::program_options::value<std::string>(),
161-
"Job Mode for MessageLogger defaults - default mode is grid")(
162-
kNumberOfThreadsCommandOpt,
163-
boost::program_options::value<unsigned int>(),
164-
"Number of threads to use in job (0 is use all CPUs)")(
165-
kSizeOfStackForThreadCommandOpt,
166-
boost::program_options::value<unsigned int>(),
167-
"Size of stack in KB to use for extra threads (0 is use system default size)")(kStrictOpt, "strict parsing");
156+
"configuration file")(kJobreportCommandOpt,
157+
boost::program_options::value<std::string>(),
158+
"file name to use for a job report file: default extension is "
159+
".xml")(kEnableJobreportCommandOpt,
160+
"enable job report files (if any) specified in configuration "
161+
"file")(kJobModeCommandOpt,
162+
boost::program_options::value<std::string>(),
163+
"Job Mode for MessageLogger defaults - default mode is "
164+
"grid")(kNumberOfThreadsCommandOpt,
165+
boost::program_options::value<unsigned int>(),
166+
"Number of threads to use in job (0 is use all "
167+
"CPUs)")(kSizeOfStackForThreadCommandOpt,
168+
boost::program_options::value<unsigned int>(),
169+
"Size of stack in KB to use for extra threads (0 is "
170+
"use system default size)")(kStrictOpt,
171+
"strict parsing");
168172

169173
// anything at the end will be ignored, and sent to python
170174
boost::program_options::positional_options_description p;

0 commit comments

Comments
 (0)