Skip to content

Commit

Permalink
Remove unnecessary operations in Promise.
Browse files Browse the repository at this point in the history
We're allocating memory we don't use and calling functions that it would make more sense to inline.
  • Loading branch information
player-03 authored Sep 2, 2024
1 parent 96c5c1c commit 169e737
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lime/app/Promise.hx
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ class Promise<T>
Whether the `Promise` (and related `Future`) has finished with a completion state.
This will be `false` if the `Promise` has not been resolved with a completion or error state.
**/
public var isComplete(get, null):Bool;
public var isComplete(get, never):Bool;

/**
Whether the `Promise` (and related `Future`) has finished with an error state.
This will be `false` if the `Promise` has not been resolved with a completion or error state.
**/
public var isError(get, null):Bool;
public var isError(get, never):Bool;

#if commonjs
private static function __init__()
Expand Down Expand Up @@ -179,12 +179,12 @@ class Promise<T>
}

// Get & Set Methods
@:noCompletion private function get_isComplete():Bool
@:noCompletion private inline function get_isComplete():Bool
{
return future.isComplete;
}

@:noCompletion private function get_isError():Bool
@:noCompletion private inline function get_isError():Bool
{
return future.isError;
}
Expand Down

0 comments on commit 169e737

Please sign in to comment.