Skip to content

Inline calls to functions that have a single-line expression or statement #49

@SamTebbs33

Description

@SamTebbs33

Calls to functions that have a single-line expression or statement should be inlined.

func isArrayIndex(index : int) : bool -> index >= 0 && index < length

A call to this function

const i = 10
var isValid = isArrayIndex(i)

Would be compiled to

const i = 10
var isValid = i >= 0 && i < length

An example function that uses a single-line statement

func print(msg : String?) -> System.out.println("Log: " + msg)

The function call print("Hello!") would be inlined to System.out.println("Log: Hello!")

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions