Skip to content

Commit 2d0e20f

Browse files
committed
Variable: Return by reference
1 parent 83e45f2 commit 2d0e20f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/scratch/variable.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ std::string Variable::name() const
2626
}
2727

2828
/*! Returns the value. */
29-
Value Variable::value() const
29+
const Value &Variable::value() const
3030
{
3131
return m_value;
3232
}

src/scratch/variable.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class LIBSCRATCHCPP_EXPORT Variable : public IEntity
1919

2020
std::string name() const;
2121

22-
Value value() const;
22+
const Value &value() const;
2323
void setValue(const Value &value);
2424

2525
bool isCloudVariable() const;

0 commit comments

Comments
 (0)