Skip to content

Commit 5f39355

Browse files
committed
appease clang tidy
1 parent 03729eb commit 5f39355

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/weighted_list.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,8 @@ template <typename T, typename W> struct weighted_list {
235235
}
236236

237237
void deserialize( const JsonValue &jv ) {
238+
// this function does things in a way that makes clang-tidy unhappy
239+
// CATA_DO_NOT_CHECK_SERIALIZE
238240
if( jv.test_array() ) {
239241
for( const JsonValue entry : jv.get_array() ) {
240242
if( entry.test_array() ) {
@@ -248,7 +250,7 @@ template <typename T, typename W> struct weighted_list {
248250
}
249251
}
250252
} else {
251-
jv.throw_error( "weighted list must be in format [[a, b], ...]" );
253+
jv.throw_error( "weighted list must be in format [[a, b], ]" );
252254
}
253255
}
254256

@@ -264,7 +266,7 @@ template <typename T, typename W> struct weighted_list {
264266
template <typename T> struct weighted_int_list : public weighted_list<T, int> {
265267

266268
weighted_int_list() = default;
267-
weighted_int_list( int default_weight ) : default_weight( default_weight ) {};
269+
explicit weighted_int_list( int default_weight ) : default_weight( default_weight ) {};
268270
// populate the precalc_array for O(1) lookups
269271
void precalc() {
270272
precalc_array.clear();
@@ -314,7 +316,7 @@ template <typename T> struct weighted_float_list : public weighted_list<T, doubl
314316

315317
// TODO: precalc using alias method
316318
weighted_float_list() = default;
317-
weighted_float_list( int default_weight ) : default_weight( default_weight ) {};
319+
explicit weighted_float_list( int default_weight ) : default_weight( default_weight ) {};
318320

319321
protected:
320322

0 commit comments

Comments
 (0)