Skip to content

Redundant function input args slicing #47

@dy

Description

@dy

Transpiling

vec4 lerp(vec4 a, vec4 b, float t) {
	return t * b + (1. - t) * a;
}

gives

		function lerp (a, b, t) {
			a = a.slice();
			b = b.slice();
			return [t * b[0] + (1. - t) * a[0], t * b[1] + (1. - t) * a[1], t * b[2] + (1. - t) * a[2], t * b[3] + (1. - t) * a[3]];
		}

which has redundant slicing: slower performance, longer output. Probably we should guard mutation only in case of out qualifiers.

@Pessimistress what do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions