Usage of a function in loops should be avoided. Pre-calculating value now.

Signed-off-by: Florian Wolters <wolters.fl@gmail.com>