Skip to content

Commit bf13e7f

Browse files
committed
List: Return by reference
1 parent 2d0e20f commit bf13e7f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/scratch/list.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ std::deque<Value> List::items() const
3131
}
3232

3333
/*! Returns the item at index. */
34-
Value List::at(int index) const
34+
const Value &List::at(int index) const
3535
{
3636
return m_items[index];
3737
}

src/scratch/list.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class LIBSCRATCHCPP_EXPORT List : public IEntity
2121
void setName(const std::string &name);
2222

2323
std::deque<Value> items() const;
24-
Value at(int index) const;
24+
const Value &at(int index) const;
2525
int indexOf(const Value &value) const;
2626
int size() const;
2727
int length() const;

0 commit comments

Comments
 (0)