@@ -20,8 +20,8 @@ constexpr size_t kMaxThreads = 16;
20
20
// Safe string class that logs error when index is accessed outside the string.
21
21
class SafeString : public std ::string {
22
22
public:
23
- SafeString () = default ;
24
- SafeString (const std::string &s) : std::string(s) {}
23
+ explicit SafeString () = default;
24
+ explicit SafeString (const std::string &s) : std::string(s) {}
25
25
const char &operator [](size_t i) const {
26
26
if (i >= size ()) {
27
27
printf (" ERROR string index access index=%zu str=%s\n " , i, c_str ());
@@ -53,7 +53,7 @@ struct PreparedQuery {
53
53
Element ext;
54
54
std::set<char > charCodes{};
55
55
56
- PreparedQuery (const Element &q, const char pathSeparator);
56
+ explicit PreparedQuery (const Element &q, const char pathSeparator);
57
57
};
58
58
59
59
struct Options {
@@ -68,16 +68,16 @@ struct Options {
68
68
#endif
69
69
const PreparedQuery preparedQuery;
70
70
71
- Options (const Element &_query, size_t _maxResults, bool _usePathScoring, bool _useExtensionBonus) : max_results(_maxResults), usePathScoring(_usePathScoring), useExtensionBonus(_useExtensionBonus), preparedQuery(_query, pathSeparator) {}
72
- Options (const Element &_query, char _pathSeparator) : pathSeparator(_pathSeparator), preparedQuery(_query, _pathSeparator) {}
71
+ explicit Options (const Element &_query, size_t _maxResults, bool _usePathScoring, bool _useExtensionBonus) : max_results(_maxResults), usePathScoring(_usePathScoring), useExtensionBonus(_useExtensionBonus), preparedQuery(_query, pathSeparator) {}
72
+ explicit Options (const Element &_query, char _pathSeparator) : pathSeparator(_pathSeparator), preparedQuery(_query, _pathSeparator) {}
73
73
};
74
74
75
75
struct AcronymResult {
76
76
Score score;
77
77
float pos;
78
78
int count;
79
79
80
- AcronymResult (Score s, float p, int c) noexcept : score(s), pos(p), count(c) {}
80
+ explicit AcronymResult (Score s, float p, int c) noexcept : score(s), pos(p), count(c) {}
81
81
};
82
82
83
83
extern Element ToLower (const Element &s);
0 commit comments