From 69f02d803bbf3a7869d7bdeb1957a9daafa15374 Mon Sep 17 00:00:00 2001 From: JunsuChoi Date: Fri, 19 Feb 2021 16:12:11 +0900 Subject: [PATCH] shape: Refactoring to use initialize list Member data should be initialized in-class or in a constructor initialization list --- src/lib/tvgShapeImpl.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/tvgShapeImpl.h b/src/lib/tvgShapeImpl.h index c50f9387..67aba9c5 100644 --- a/src/lib/tvgShapeImpl.h +++ b/src/lib/tvgShapeImpl.h @@ -41,11 +41,11 @@ struct ShapeStroke ShapeStroke() {} ShapeStroke(const ShapeStroke* src) + : width(src->width), + dashCnt(src->dashCnt), + cap(src->cap), + join(src->join) { - width = src->width; - dashCnt = src->dashCnt; - cap = src->cap; - join = src->join; memcpy(color, src->color, sizeof(color)); dashPattern = static_cast(malloc(sizeof(float) * dashCnt)); memcpy(dashPattern, src->dashPattern, sizeof(float) * dashCnt);