You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (Jira)" <ji...@apache.org> on 2022/02/03 22:30:00 UTC

[jira] [Closed] (GROOVY-10395) SC: <=> compiled to ScriptBytecodeAdapter#compareTo for primitives

     [ https://issues.apache.org/jira/browse/GROOVY-10395?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul King closed GROOVY-10395.
------------------------------

> SC: <=> compiled to ScriptBytecodeAdapter#compareTo for primitives
> ------------------------------------------------------------------
>
>                 Key: GROOVY-10395
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10395
>             Project: Groovy
>          Issue Type: Improvement
>          Components: Static compilation
>            Reporter: Eric Milles
>            Assignee: Eric Milles
>            Priority: Major
>             Fix For: 4.0.0-rc-2
>
>
> Consider the following:
> {code:groovy}
> @groovy.transform.CompileStatic
> int cmp(int a, int b) {
>   a <=> b
> }
> {code}
> "a <=> b" for primitive types is not optimized to make use of Integer#compare or similar – instead it is transformed into {{ScriptBytecodeAdapter.compareTo(a,b)}}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)