Skip to content

Commit b4e05b1

Browse files
committed
Block: Pass defaultRetValue by reference
1 parent 593010c commit b4e05b1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/scratch/block.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Block::Block(std::string id, std::string opcode) :
1919
* \param[in] script The script from which the block was called. Call be nullptr for reporter blocks.
2020
* \param[out] defaultRetValue Value to return when the block isn't supported.
2121
*/
22-
Value Block::run(RunningScript *script, Value defaultRetValue)
22+
Value Block::run(RunningScript *script, const Value &defaultRetValue)
2323
{
2424
if (m_implementation)
2525
return m_implementation(BlockArgs(m_target, m_engine, script, this));

src/scratch/block.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class LIBSCRATCHCPP_EXPORT Block : public IEntity
2020
Block(std::string id, std::string opcode);
2121
Block(const Block &) = delete;
2222

23-
Value run(RunningScript *script = nullptr, Value defaultRetValue = Value());
23+
Value run(RunningScript *script = nullptr, const Value &defaultRetValue = Value());
2424

2525
std::string opcode() const;
2626

0 commit comments

Comments
 (0)