From 8706eca90527cf2a7f4e05b3a6d645d194b7fc5c Mon Sep 17 00:00:00 2001 From: subhransu mohanty Date: Thu, 29 Nov 2018 15:38:40 +0900 Subject: [PATCH] lottie/vector: take the fast path in addPath() api only when path is null. This patch is to avoid unnecessary allocation and deallocation when the path is empty but not null during addPath Change-Id: Iab3820419257fbbecaddc93d73e5868b1889e6c5 --- src/vector/vpath.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vector/vpath.h b/src/vector/vpath.h index 8cec2d7..f336103 100644 --- a/src/vector/vpath.h +++ b/src/vector/vpath.h @@ -228,7 +228,7 @@ inline void VPath::addPath(const VPath &path) { if (path.empty()) return; - if (empty()) { + if (null()) { *this = path; } else { d.write().addPath(path.d.read()); -- 2.34.1