Skip to content

Commit 64f2e39

Browse files
authored
Enable performance-* clang-tidy checks (#1860)
Signed-off-by: Balakrishna Avulapati <[email protected]>
1 parent bc3a4e6 commit 64f2e39

File tree

8 files changed

+12
-8
lines changed

8 files changed

+12
-8
lines changed

cmake/common/clang-tidy.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"Checks": "-*, concurrency-*, modernize-*, portability-*",
2+
"Checks": "-*, concurrency-*, modernize-*, performance-*, portability-*",
33
"WarningsAsErrors": "*",
44
"FormatStyle": "none",
55
"UseColor": true

src/core/json/include/sourcemeta/core/json_value.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class SOURCEMETA_CORE_JSON_EXPORT JSON {
4545
/// The object type used by the JSON document.
4646
using Object = JSONObject<String, JSON, PropertyHashJSON<JSON::String>>;
4747
/// The parsing phase of a JSON document.
48-
enum class ParsePhase { Pre, Post };
48+
enum class ParsePhase : std::uint8_t { Pre, Post };
4949
// The enumeration indexes must stay in sync with the internal variant
5050
/// The different types of a JSON instance.
5151
enum class Type : std::uint8_t {

src/core/jsonpointer/include/sourcemeta/core/jsonpointer_template.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
#include <algorithm> // std::copy, std::all_of
77
#include <cassert> // assert
8+
#include <cstdint> // std::uint8_t
89
#include <initializer_list> // std::initializer_list
910
#include <iterator> // std::back_inserter
1011
#include <optional> // std::optional, std::nullopt
@@ -16,7 +17,7 @@ namespace sourcemeta::core {
1617
/// @ingroup jsonpointer
1718
template <typename PointerT> class GenericPointerTemplate {
1819
public:
19-
enum class Wildcard { Property, Item, Key };
20+
enum class Wildcard : std::uint8_t { Property, Item, Key };
2021
struct Condition {
2122
auto operator==(const Condition &) const noexcept -> bool = default;
2223
auto operator<(const Condition &) const noexcept -> bool { return false; }

src/core/jsonschema/include/sourcemeta/core/jsonschema_frame.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class SOURCEMETA_CORE_JSONSCHEMA_EXPORT SchemaFrame {
105105
public:
106106
/// The mode of framing. More extensive analysis can be compute and memory
107107
/// intensive
108-
enum class Mode { Locations, References, Instances };
108+
enum class Mode : std::uint8_t { Locations, References, Instances };
109109

110110
SchemaFrame(const Mode mode) : mode_{mode} {}
111111

src/core/uri/include/sourcemeta/core/uri_escape.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
#include <sourcemeta/core/uri_export.h>
66
#endif
77

8+
#include <cstdint> // std::uint8_t
89
#include <istream> // std::istream
910
#include <ostream> // std::ostream
1011

1112
namespace sourcemeta::core {
1213

1314
/// @ingroup uri
14-
enum class URIEscapeMode {
15+
enum class URIEscapeMode : std::uint8_t {
1516
// Escape every characted that is not in the URI "unreserved" ABNF category
1617
// See https://www.rfc-editor.org/rfc/rfc3986#appendix-A
1718
SkipUnreserved,

src/extension/alterschema/include/sourcemeta/core/alterschema.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@
1616

1717
#include <sourcemeta/core/jsonschema.h>
1818

19+
#include <cstdint> // std::uint8_t
20+
1921
namespace sourcemeta::core {
2022

2123
/// @ingroup alterschema
2224
/// The category of a built-in transformation rule
23-
enum class AlterSchemaMode {
25+
enum class AlterSchemaMode : std::uint8_t {
2426
/// Rules that simplify the given schema for both human readability and
2527
/// performance
2628
Readability,

src/extension/alterschema/linter/draft_official_dialect_without_empty_fragment.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@ class DraftOfficialDialectWithoutEmptyFragment final
3939
auto transform(sourcemeta::core::JSON &schema) const -> void override {
4040
auto schema_value = schema.at("$schema").to_string();
4141
schema_value += "#";
42-
schema.at("$schema").into(sourcemeta::core::JSON{std::move(schema_value)});
42+
schema.at("$schema").into(sourcemeta::core::JSON{schema_value});
4343
}
4444
};

src/extension/alterschema/linter/modern_official_dialect_with_empty_fragment.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ class ModernOfficialDialectWithEmptyFragment final
3131
auto transform(sourcemeta::core::JSON &schema) const -> void override {
3232
auto schema_value = schema.at("$schema").to_string();
3333
schema_value.pop_back();
34-
schema.at("$schema").into(sourcemeta::core::JSON{std::move(schema_value)});
34+
schema.at("$schema").into(sourcemeta::core::JSON{schema_value});
3535
}
3636
};

0 commit comments

Comments
 (0)