Analyzer: Move setIfPresent helper function close to the only user

Change-Id: I8d99fe6438e4d954ad44403ac4a34f7e85a7f021
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>