From b5d14cd4fe7af4fa9d9937d1ee9a7918f6d29436 Mon Sep 17 00:00:00 2001 From: Renan araujo Date: Sat, 14 Dec 2024 21:02:29 +0000 Subject: [PATCH 1/2] refactor:remove dead code --- packages/forge2d/lib/src/collision/distance.dart | 2 -- .../forge2d/lib/src/collision/time_of_impact.dart | 12 ++---------- packages/forge2d/lib/src/dynamics/fixture.dart | 4 +--- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/packages/forge2d/lib/src/collision/distance.dart b/packages/forge2d/lib/src/collision/distance.dart index 9bbda36..8b5bbdd 100644 --- a/packages/forge2d/lib/src/collision/distance.dart +++ b/packages/forge2d/lib/src/collision/distance.dart @@ -501,8 +501,6 @@ class DistanceProxy { _count = 2; radius = edge.radius; break; - default: - assert(false); } } diff --git a/packages/forge2d/lib/src/collision/time_of_impact.dart b/packages/forge2d/lib/src/collision/time_of_impact.dart index dd85b32..9ffb193 100644 --- a/packages/forge2d/lib/src/collision/time_of_impact.dart +++ b/packages/forge2d/lib/src/collision/time_of_impact.dart @@ -411,12 +411,7 @@ class SeparationFunction { _pointA.setFrom(Transform.mulVec2(_xfa, _localPointA)); return (_pointA..sub(_pointB)).dot(_normal); - default: - assert(false); - indexes[0] = -1; - indexes[1] = -1; - return 0.0; - } + } } double evaluate(int indexA, int indexB, double t) { @@ -447,9 +442,6 @@ class SeparationFunction { _pointA.setFrom(Transform.mulVec2(_xfa, _localPointA)); return (_pointA..sub(_pointB)).dot(_normal); - default: - assert(false); - return 0.0; - } + } } } diff --git a/packages/forge2d/lib/src/dynamics/fixture.dart b/packages/forge2d/lib/src/dynamics/fixture.dart index 3df380d..fa7855d 100644 --- a/packages/forge2d/lib/src/dynamics/fixture.dart +++ b/packages/forge2d/lib/src/dynamics/fixture.dart @@ -321,8 +321,6 @@ class Fixture { } } break; - default: - break; - } + } } } From 3f8a4a5f44b1810640d765e8d1bdcbcb684469df Mon Sep 17 00:00:00 2001 From: Renan araujo Date: Sat, 14 Dec 2024 21:04:27 +0000 Subject: [PATCH 2/2] format --- packages/forge2d/lib/src/collision/time_of_impact.dart | 4 ++-- packages/forge2d/lib/src/dynamics/fixture.dart | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/forge2d/lib/src/collision/time_of_impact.dart b/packages/forge2d/lib/src/collision/time_of_impact.dart index 9ffb193..d2f2105 100644 --- a/packages/forge2d/lib/src/collision/time_of_impact.dart +++ b/packages/forge2d/lib/src/collision/time_of_impact.dart @@ -411,7 +411,7 @@ class SeparationFunction { _pointA.setFrom(Transform.mulVec2(_xfa, _localPointA)); return (_pointA..sub(_pointB)).dot(_normal); - } + } } double evaluate(int indexA, int indexB, double t) { @@ -442,6 +442,6 @@ class SeparationFunction { _pointA.setFrom(Transform.mulVec2(_xfa, _localPointA)); return (_pointA..sub(_pointB)).dot(_normal); - } + } } } diff --git a/packages/forge2d/lib/src/dynamics/fixture.dart b/packages/forge2d/lib/src/dynamics/fixture.dart index fa7855d..902fe84 100644 --- a/packages/forge2d/lib/src/dynamics/fixture.dart +++ b/packages/forge2d/lib/src/dynamics/fixture.dart @@ -321,6 +321,6 @@ class Fixture { } } break; - } + } } }