projects
/
platform
/
core
/
uifw
/
lottie-player.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dfe59f9
)
lottie/vector: reserve memory only when required.
74/185374/1
author
subhransu mohanty
<sub.mohanty@samsung.com>
Mon, 30 Jul 2018 05:34:24 +0000
(14:34 +0900)
committer
subhransu mohanty
<sub.mohanty@samsung.com>
Mon, 30 Jul 2018 05:34:24 +0000
(14:34 +0900)
Change-Id: Ia86c292d66c1060d33ccffd2fe5922480d219eb4
src/vector/vrle.cpp
patch
|
blob
|
history
diff --git
a/src/vector/vrle.cpp
b/src/vector/vrle.cpp
index
87365f5
..
7fd4004
100644
(file)
--- a/
src/vector/vrle.cpp
+++ b/
src/vector/vrle.cpp
@@
-303,7
+303,8
@@
inline static void copyArrayToVector(const VRle::Span *span, int count,
std::vector<VRle::Span> &v)
{
// make sure enough memory available
- v.reserve(v.size() + count);
+ if (v.capacity() < v.size() + count)
+ v.reserve(v.size() + count);
std::copy(span, span + count, back_inserter(v));
}