EventTimeline::getFrames returns const & to avoid copying. (#2087)

* EventTimeline::getFrames returns const & to avoid copying.

* EventTimeline::getFrames returns const & to avoid copying.
This commit is contained in:
James Chen 2022-05-30 21:47:19 +08:00 committed by GitHub
parent 28727aff22
commit 674fab37f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -51,7 +51,7 @@ namespace spine {
/// Sets the time and value of the specified keyframe.
void setFrame(size_t frameIndex, Event* event);
Vector<float> getFrames();
const Vector<float>& getFrames();
Vector<Event*>& getEvents();
size_t getFrameCount();

View File

@ -104,7 +104,7 @@ void EventTimeline::setFrame(size_t frameIndex, Event *event) {
_events[frameIndex] = event;
}
Vector<float> EventTimeline::getFrames() { return _frames; }
const Vector<float>& EventTimeline::getFrames() { return _frames; }
Vector<Event *> &EventTimeline::getEvents() { return _events; }