Minor optimization for function/unique_function