From c9f05526a83ad9a644a0ed8bf7e00261b1951c59 Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Mon, 20 May 2024 22:22:20 +0900 Subject: [PATCH] wasm: code clean up binary reduction by -188 --- src/bindings/wasm/tvgWasmLottieAnimation.cpp | 22 ++++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/bindings/wasm/tvgWasmLottieAnimation.cpp b/src/bindings/wasm/tvgWasmLottieAnimation.cpp index 3cdb25dd..9d10c625 100644 --- a/src/bindings/wasm/tvgWasmLottieAnimation.cpp +++ b/src/bindings/wasm/tvgWasmLottieAnimation.cpp @@ -39,9 +39,9 @@ public: Initializer::term(); } - static unique_ptr create() + static TvgLottieAnimation* create() { - return unique_ptr(new TvgLottieAnimation()); + return new TvgLottieAnimation; } string error() @@ -55,22 +55,22 @@ public: return val(typed_memory_view(2, psize)); } - val duration() + float duration() { - if (!canvas || !animation) return val(0); - return val(animation->duration()); + if (!canvas || !animation) return 0; + return animation->duration(); } - val totalFrame() + float totalFrame() { - if (!canvas || !animation) return val(0); - return val(animation->totalFrame()); + if (!canvas || !animation) return 0; + return animation->totalFrame(); } - val curFrame() + float curFrame() { - if (!canvas || !animation) return val(0); - return val(animation->curFrame()); + if (!canvas || !animation) return 0; + return animation->curFrame(); } // Render methods