diff --git a/src/plugins/intel_cpu/src/node.cpp b/src/plugins/intel_cpu/src/node.cpp index ddf8d068f920a2..4aeffce7591839 100644 --- a/src/plugins/intel_cpu/src/node.cpp +++ b/src/plugins/intel_cpu/src/node.cpp @@ -337,7 +337,7 @@ void Node::selectPreferPrimitiveDescriptor(const std::vector& pr bool Node::isOneDimShape(const ov::PartialShape& pshape) { int value_1_num = 0; int sz = static_cast(pshape.size()); - for (auto s : pshape) { + for (const auto& s : pshape) { if (s.is_static() && s.get_length() == 1) { value_1_num++; } @@ -345,7 +345,7 @@ bool Node::isOneDimShape(const ov::PartialShape& pshape) { return value_1_num >= sz - 1; } -bool Node::isReorderRequired(ov::intel_cpu::MemoryDescPtr desc1, ov::intel_cpu::MemoryDescPtr desc2) { +bool Node::isReorderRequired(const ov::intel_cpu::MemoryDescPtr& desc1, const ov::intel_cpu::MemoryDescPtr& desc2) { bool samePrec = desc1->getPrecision() == desc2->getPrecision(); bool isOneDimShape1 = isOneDimShape(desc1->getShape().toPartialShape()); bool isOneDimShape2 = isOneDimShape(desc2->getShape().toPartialShape()); diff --git a/src/plugins/intel_cpu/src/node.h b/src/plugins/intel_cpu/src/node.h index 9166e87dbf50e1..6b08fc54728375 100644 --- a/src/plugins/intel_cpu/src/node.h +++ b/src/plugins/intel_cpu/src/node.h @@ -752,7 +752,7 @@ class Node { void selectPreferPrimitiveDescriptor(const std::vector& priority, bool ignoreConstInputs); void selectPreferPrimitiveDescriptorWithShape(const std::vector& priority, bool ignoreConstInputs); bool isOneDimShape(const ov::PartialShape& pshape); - bool isReorderRequired(ov::intel_cpu::MemoryDescPtr desc1, ov::intel_cpu::MemoryDescPtr desc2); + bool isReorderRequired(const ov::intel_cpu::MemoryDescPtr& desc1, const ov::intel_cpu::MemoryDescPtr& desc2); bool isConfigDefined(const NodeConfig& config) const; virtual bool canBeInPlace() const;