Small Optimizations

This commit is contained in:
NeeEoo
2024-04-05 21:21:19 +02:00
parent 7b279bfed0
commit 8174fef53d
6 changed files with 17 additions and 28 deletions
+4 -16
View File
@@ -227,7 +227,7 @@ class FunkinSprite extends FlxSkewedSprite implements IBeatReceiver implements I
for (key in animOffsets.keys()) {
final point = animOffsets[key];
animOffsets.remove(key);
if(point != null)
if (point != null)
point.put();
}
animOffsets = null;
@@ -322,19 +322,8 @@ class FunkinSprite extends FlxSkewedSprite implements IBeatReceiver implements I
return animateAtlas != null ? (animateAtlas.anim.animsMap.exists(AnimName)
|| animateAtlas.anim.symbolDictionary.exists(AnimName)) : animation.exists(AnimName);
public inline function getAnimName()
{
var name = null;
if (animateAtlas != null)
{
name = atlasPlayingAnim;
}
else
{
if (animation.curAnim != null)
name = animation.curAnim.name;
}
return name;
public inline function getAnimName() {
return (animateAtlas != null) ? atlasPlayingAnim : animation.name;
}
public inline function removeAnimation(name:String) {
@@ -358,8 +347,7 @@ class FunkinSprite extends FlxSkewedSprite implements IBeatReceiver implements I
animation.stop();
}
public inline function isAnimFinished()
{
public inline function isAnimFinished() {
return animateAtlas != null ? (animateAtlas.anim.finished) : (animation.curAnim != null ? animation.curAnim.finished : true);
}
#end
+1 -1
View File
@@ -134,7 +134,7 @@ class MemoryUtil {
if (process.exitCode() != 0) return "Unknown";
var lines = process.stdout.readAll().toString().split("\n");
for (line in lines) {
if (line.indexOf("Type:") == 0) {
if (line.startsWith("Type:")) {
return line.substring("Type:".length).trim();
}
}