-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework direct API for object comparison
Add sq_direct_is_equal() - this is not the same as invoking ObjCmp() on objects. Logic of this comparison is the same as for <=> operator and it can fail in certain scenarios. Also for safety such comparison of non-numeric types (or classes implementing _cmp metamethod) will be disabled soon. In practice sq_direct_cmp() function was never needed - in all the cases it was used for the equality check. For this, implement sq_direct_is_equal() function. Also simplify sq_direct_cmp() implementation - make it a thin wrapper around SQVM::ObjCmp(). No need for extra logic that differs from VM internals.
- Loading branch information
1 parent
7934d9b
commit 76078d9
Showing
4 changed files
with
18 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters