rebase: move constant expressions out of inner loop in _performrebase()

Authored by martinvonz.

Description

rebase: move constant expressions out of inner loop in _performrebase()

Differential Revision: https://phab.mercurial-scm.org/D2811

Details