We will be at OWASP APPSEC EUROPE 2017 - Belfast! Let’s talk!MORE INFO

Help Center

Get to know more about our API, Code Annotations and Code Transformations

Constant Folding

Potency
1 / 3
Resilience
5 / 5
Cost
0 / 5

Tags: optimization,constant,folding,minification,compiler

Description

Constant folding is a compiler optimization. The transformation evaluates
constant expressions at compile-time to reduce them to the minimum equivalent
expression reducing the computing effort in run-time.

Example

The following example shows an expression that evaluate to a constant value:

1
1 + 2 + '' + 3;

Because this always produce the same output, we can replace the expression with
its constant value.

1
'33';

API Parameters

Example:

1
2
3
4
5
6
7
8
9
10
11
12
{
"keys": {
"accessKey": "XXXXXX",
"secretKey": "YYYYYY"
},
"applicationId": "ZZZZZZ",
"params": [
{
"name": "constantFolding"
}
]
}