Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 34af9d1

Browse files
committed
Turned on performance-unnecessary-value-param everywhere.
1 parent c1200c4 commit 34af9d1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+116
-94
lines changed

.clang-tidy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ clang-analyzer-*,\
2828
readability-identifier-naming,\
2929
clang-diagnostic-*,\
3030
google-objc-*,\
31-
google-explicit-constructor"
31+
google-explicit-constructor,\
32+
performance-unnecessary-value-param"
3233

3334
CheckOptions:
3435
- key: modernize-use-default-member-init.UseAssignment

ci/lint.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ DART_BIN="${SRC_DIR}/third_party/dart/tools/sdks/dart-sdk/bin"
3434
DART="${DART_BIN}/dart"
3535
# TODO(https://github.com/flutter/flutter/issues/113848): Migrate all platforms
3636
# to have this as an error.
37-
MAC_HOST_WARNINGS_AS_ERRORS="performance-move-const-arg,performance-unnecessary-value-param"
37+
MAC_HOST_WARNINGS_AS_ERRORS="performance-move-const-arg"
3838

39+
FLUTTER_LINT_PRINT_FIX=1
3940
# FLUTTER_LINT_PRINT_FIX will make it so that fix is executed and the generated
4041
# diff is printed to stdout if clang-tidy fails. This is helpful for enabling
4142
# new lints.

fml/platform/android/jni_weak_ref.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,14 @@ ScopedJavaLocalRef<jobject> GetRealObject(JNIEnv* env, jweak obj) {
5454
}
5555

5656
void JavaObjectWeakGlobalRef::Assign(const JavaObjectWeakGlobalRef& other) {
57-
if (&other == this)
57+
if (&other == this) {
5858
return;
59+
}
5960

6061
JNIEnv* env = AttachCurrentThread();
61-
if (obj_)
62+
if (obj_) {
6263
env->DeleteWeakGlobalRef(obj_);
64+
}
6365

6466
obj_ = other.obj_ ? env->NewWeakGlobalRef(other.obj_) : NULL;
6567
}

impeller/renderer/backend/vulkan/command_buffer_vk.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
#include "impeller/renderer/backend/vulkan/command_buffer_vk.h"
66

7+
#include <utility>
8+
79
#include "flutter/fml/logging.h"
810
#include "impeller/base/validation.h"
911
#include "impeller/renderer/backend/vulkan/context_vk.h"
@@ -15,7 +17,7 @@
1517
namespace impeller {
1618

1719
std::shared_ptr<CommandBufferVK> CommandBufferVK::Create(
18-
std::weak_ptr<const Context> context,
20+
const std::weak_ptr<const Context>& context,
1921
vk::Device device,
2022
vk::CommandPool command_pool,
2123
SurfaceProducerVK* surface_producer) {
@@ -41,7 +43,7 @@ CommandBufferVK::CommandBufferVK(std::weak_ptr<const Context> context,
4143
SurfaceProducerVK* surface_producer,
4244
vk::CommandPool command_pool,
4345
vk::UniqueCommandBuffer command_buffer)
44-
: CommandBuffer(context),
46+
: CommandBuffer(std::move(context)),
4547
device_(device),
4648
command_pool_(command_pool),
4749
command_buffer_(std::move(command_buffer)),

impeller/renderer/backend/vulkan/command_buffer_vk.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace impeller {
1414
class CommandBufferVK final : public CommandBuffer {
1515
public:
1616
static std::shared_ptr<CommandBufferVK> Create(
17-
std::weak_ptr<const Context> context,
17+
const std::weak_ptr<const Context>& context,
1818
vk::Device device,
1919
vk::CommandPool command_pool,
2020
SurfaceProducerVK* surface_producer);

impeller/renderer/backend/vulkan/device_buffer_vk.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ DeviceBufferVK::DeviceBufferVK(
3939
DeviceBufferDescriptor desc,
4040
ContextVK& context,
4141
std::unique_ptr<DeviceBufferAllocationVK> device_allocation)
42-
: DeviceBuffer(std::move(desc)),
42+
: DeviceBuffer(desc),
4343
context_(context),
4444
device_allocation_(std::move(device_allocation)) {}
4545

impeller/renderer/backend/vulkan/pipeline_vk.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ vk::DescriptorSetLayout PipelineCreateInfoVK::GetDescriptorSetLayout() const {
4040
}
4141

4242
PipelineVK::PipelineVK(std::weak_ptr<PipelineLibrary> library,
43-
PipelineDescriptor desc,
43+
const PipelineDescriptor& desc,
4444
std::unique_ptr<PipelineCreateInfoVK> create_info)
45-
: Pipeline(std::move(library), std::move(desc)),
45+
: Pipeline(std::move(library), desc),
4646
pipeline_info_(std::move(create_info)) {}
4747

4848
PipelineVK::~PipelineVK() = default;

impeller/renderer/backend/vulkan/pipeline_vk.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class PipelineVK final
4343
public BackendCast<PipelineVK, Pipeline<PipelineDescriptor>> {
4444
public:
4545
PipelineVK(std::weak_ptr<PipelineLibrary> library,
46-
PipelineDescriptor desc,
46+
const PipelineDescriptor& desc,
4747
std::unique_ptr<PipelineCreateInfoVK> create_info);
4848

4949
// |Pipeline|

impeller/renderer/backend/vulkan/surface_producer_vk.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "impeller/renderer/backend/vulkan/surface_producer_vk.h"
66

77
#include <array>
8+
#include <utility>
89

910
#include "impeller/base/validation.h"
1011
#include "impeller/renderer/backend/vulkan/surface_vk.h"
@@ -13,7 +14,7 @@
1314
namespace impeller {
1415

1516
std::unique_ptr<SurfaceProducerVK> SurfaceProducerVK::Create(
16-
std::weak_ptr<Context> context,
17+
const std::weak_ptr<Context>& context,
1718
const SurfaceProducerCreateInfoVK& create_info) {
1819
auto surface_producer =
1920
std::make_unique<SurfaceProducerVK>(context, create_info);
@@ -28,7 +29,7 @@ std::unique_ptr<SurfaceProducerVK> SurfaceProducerVK::Create(
2829
SurfaceProducerVK::SurfaceProducerVK(
2930
std::weak_ptr<Context> context,
3031
const SurfaceProducerCreateInfoVK& create_info)
31-
: context_(context), create_info_(create_info) {}
32+
: context_(std::move(context)), create_info_(create_info) {}
3233

3334
SurfaceProducerVK::~SurfaceProducerVK() = default;
3435

impeller/renderer/backend/vulkan/surface_producer_vk.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class SurfaceSyncObjectsVK {
3333
class SurfaceProducerVK {
3434
public:
3535
static std::unique_ptr<SurfaceProducerVK> Create(
36-
std::weak_ptr<Context> context,
36+
const std::weak_ptr<Context>& context,
3737
const SurfaceProducerCreateInfoVK& create_info);
3838

3939
SurfaceProducerVK(std::weak_ptr<Context> context,

0 commit comments

Comments
 (0)