From bee820884b4e4d387048ea26e04cfa7c6024576f Mon Sep 17 00:00:00 2001 From: Adil Hanney Date: Sat, 28 Dec 2024 23:00:53 +0000 Subject: [PATCH] Perf: Don't spam fpsStream with the same value --- lib/flame/ricochlime_game.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/flame/ricochlime_game.dart b/lib/flame/ricochlime_game.dart index 79cd7cd..1dc671f 100644 --- a/lib/flame/ricochlime_game.dart +++ b/lib/flame/ricochlime_game.dart @@ -328,6 +328,7 @@ class RicochlimeGame extends Forge2DGame static int get fps => _fps; static int _fps = 0; static set fps(int fps) { + if (fps == _fps) return; _fps = fps; if (_fpsStreamController.hasListener) _fpsStreamController.add(fps); }