This logic can be replaced by `return self.mapping.get(i, i)`.  This will return f if it exists and i if not.