From 9ea373e3b3b61cfa83afbe6104702c32831cc34e Mon Sep 17 00:00:00 2001 From: alestiago Date: Fri, 25 Mar 2022 09:01:25 +0000 Subject: [PATCH 1/2] refactor: removed invariant boolean --- packages/forge2d/lib/src/dynamics/world.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/forge2d/lib/src/dynamics/world.dart b/packages/forge2d/lib/src/dynamics/world.dart index 101572d5..00147444 100644 --- a/packages/forge2d/lib/src/dynamics/world.dart +++ b/packages/forge2d/lib/src/dynamics/world.dart @@ -750,7 +750,7 @@ class World { if (bodyA.sweep.alpha0 < bodyB.sweep.alpha0) { alpha0 = bodyB.sweep.alpha0; bodyA.sweep.advance(alpha0); - } else if (bodyB.sweep.alpha0 < bodyA.sweep.alpha0) { + } else { alpha0 = bodyA.sweep.alpha0; bodyB.sweep.advance(alpha0); } From 2c8e4e57c8a8eecb8690230151ac5aabf021dd98 Mon Sep 17 00:00:00 2001 From: alestiago Date: Fri, 13 May 2022 13:32:41 +0100 Subject: [PATCH 2/2] refactor: ignored lint rule --- packages/forge2d/lib/src/dynamics/world.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/forge2d/lib/src/dynamics/world.dart b/packages/forge2d/lib/src/dynamics/world.dart index 00147444..b940751f 100644 --- a/packages/forge2d/lib/src/dynamics/world.dart +++ b/packages/forge2d/lib/src/dynamics/world.dart @@ -750,7 +750,11 @@ class World { if (bodyA.sweep.alpha0 < bodyB.sweep.alpha0) { alpha0 = bodyB.sweep.alpha0; bodyA.sweep.advance(alpha0); - } else { + // NOTE: The following line is ignored due to a false positive + // analyzer warning. + // https://github.com/dart-lang/linter/issues/811 + // ignore: invariant_booleans + } else if (bodyB.sweep.alpha0 < bodyA.sweep.alpha0) { alpha0 = bodyA.sweep.alpha0; bodyB.sweep.advance(alpha0); }